Skip to content

Commit

Permalink
Merge pull request #702 from jfbercher/toc2
Browse files Browse the repository at this point in the history
Toc2: export
  • Loading branch information
jcb91 committed Jul 29, 2016
2 parents 3d7a532 + d87d012 commit ea1fcca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/jupyter_contrib_nbextensions/nbconvert_support/toc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _file_extension_default(self):
return '.html'

def _template_file_default(self):
return 'toc3'
return 'toc2'

output_mimetype = 'text/html'

Expand Down
7 changes: 6 additions & 1 deletion src/jupyter_contrib_nbextensions/nbextensions/toc2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ or
```
jupyter nbconvert FILE.ipynb --template toc2
```
An exporter is also available. It is now possible to export to html with toc by
```
jupyter nbconvert --to html_toc FILE.ipynb
```
For the first template (toc), the files toc2.js and main.css (originally located in <python site-packages>/jupyter_contrib_nbextensions/nbextensions/toc2) must reside in the same directory as intended for the html file. In the second template, these files are linked to the ipython-contrib/jupyter_contrib_nbextensions github website. Export configuration (parameters) shall be edited directly in the template files (in templates directory <python site-packages>/jupyter_contrib_nbextensions/templates). An option "Save as HTML (with toc)" is also provided in the File menu and enable to directly convert the actual notebook. This option requires the IPython kernel and is not present with other kernels.


Expand All @@ -60,4 +64,5 @@ from https://gist.github.com/magican/5574556
- @jfbercher february 21, 2016. Fixed some issues when resizing the toc window. Now avoid overflows, clip the text and add a scrollbar.
- @jfbercher february 22, 2016. Add current toc number to headings anchors. This enable to get unique anchors for recurring headings with the same text. An anchor with the original ID is still created and can be used (but toc uses the new ones!). It is also possible to directly add an html anchor within the heading text. This is taken into account when building toc links (see comments in code).
- @jfbercher april 29, 2016. Triggered by @cqcn1991, cf [discussion here](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/532), add a sidebar option. The floating toc window can be dragged and docked as a left sidebar. The sidebar can be dragged out as a floating window. These different states are stored and restored when reloading the notebook. Add html export capability via templates toc.tpl and toc2.tpl (see above).
- - @jfbercher may 04, 2016. Added a "Save as HTML with toc" menu. Added a new "Navigate" menu with presents the contents of the toc. Changed default styling for links in tocs.
- @jfbercher may 04, 2016. Added a "Save as HTML with toc" menu. Added a new "Navigate" menu with presents the contents of the toc. Changed default styling for links in tocs.
- @jfbercher july 28, 2016. A dedicated exporter was added. It is now possible to export to html with toc by `jupyter nbconvert --to html_toc FILE.ipynb`
44 changes: 0 additions & 44 deletions src/jupyter_contrib_nbextensions/templates/toc3.tpl

This file was deleted.

0 comments on commit ea1fcca

Please sign in to comment.