Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A better ipynb->html template #89

Closed
BoPeng opened this issue Jun 20, 2018 · 11 comments
Closed

A better ipynb->html template #89

BoPeng opened this issue Jun 20, 2018 · 11 comments
Assignees

Comments

@BoPeng
Copy link
Contributor

BoPeng commented Jun 20, 2018

sos convert my.ipynb my.html

is essentially calling

jupyter nbconvert

with a default template that

  1. Use pygments to generate static syntax hilighting. It serves its purpose but does not show language-specific highlighting or interpolated texts (effect of expand=True). It does not show language selector box either.

  2. No TOC, which seems to be useful to have in most cases.

Given that we already have templates for our online documentation that uses codemirror and has a toc, perhaps we should provide a better default template....

@BoPeng
Copy link
Contributor Author

BoPeng commented Jun 22, 2018

All templates have been re-written ... now we need a TOC template.

@gaow
Copy link
Member

gaow commented Jun 22, 2018

Cool -- is this page now on the new template? I noticed there seems unwanted space at the end of some of the long code cells.

@BoPeng
Copy link
Contributor Author

BoPeng commented Jun 22, 2018

I have not figured out this problem yet. The extra space is added as a min-height of the input cell so that when the cells are rendered by codemirror, the actual cell height would not change and "shake" the page. However, it has been difficult to estimate this height from number of rows so the min height can be too big for long code.

Still working on it though.

BoPeng pushed a commit that referenced this issue Jun 22, 2018
@BoPeng
Copy link
Contributor Author

BoPeng commented Jun 22, 2018

Page updated. Should be better but might shake slightly.... will see.

For TOC, need to work with http://gregfranko.com/jquery.tocify.js/.

@gaow
Copy link
Member

gaow commented Jun 22, 2018

It looks nice! I was not sure if I can see the shake, though.

The new TOC looks a lot cooler! But seems tricky to get it work with the search bar, right?

@BoPeng
Copy link
Contributor Author

BoPeng commented Jun 22, 2018

0e883ae

Three templates are added:

sos convert my.ipynb my.html --template sos-full-toc
sos convert my.ipynb my.html --template sos-report-toc
sos convert my.ipynb my.html --template sos-cm-toc

TOCs added to examples: https://vatlab.github.io/sos-docs/doc/examples/RNASeqDE.html

@gaow
Copy link
Member

gaow commented Jun 22, 2018

Great. Is the level of displayed TOC controlled by one of the template options? The example tocify page can display, when clicked on, more detailed level of headers. Wondering if that's controlled by some options.

@BoPeng
Copy link
Contributor Author

BoPeng commented Jun 22, 2018

I just used all default options of tocify. You can explore the options and adjust css and test them by pointing directly to the template file (e.g. --template src/sos_notebook/templates/sos-full-toc.tpl). One thing I would like to have is perhaps a "header" that goes to the top of the page.

@gaow
Copy link
Member

gaow commented Sep 23, 2018

I am reopening this ticket, because I received a (workflowr) report from my colleague, which is a enjoyable read.

https://willwerscheid.github.io/MASHvFLASH/MASHvFLASHnn2.html

I think what has helped the most is the Code bottom that allows me to expand the part am interested in. Our current format that expands all code is a bit hard to use in practice. I in fact find it tedious to have to set what to output for each cell (report "tag"s) and not convenient to always have to go to the top of the page to click for codes to show up.

I believe workflowr simply uses bootstrap templates. Is it something we can adopt?

@gaow gaow reopened this Sep 23, 2018
@BoPeng
Copy link
Contributor Author

BoPeng commented Sep 23, 2018

The report series of templates aims at reports that completely hides the details (see also #123). They are supposed to show only results, with code to check the details if needed. The cm series of templates aims at showing the code and results in a notebook format. What you just showed kinds of sitting in the middle and can certainly be supported with some other templates. @HenryLeongStat might be interested in checking the details.

@HenryLeongStat
Copy link
Member

Seems interesting! Will take a look at it on weekend!

@BoPeng BoPeng closed this as completed Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants