Skip to content

[toc2] basenumber#1252

Merged
jcb91 merged 1 commit intoipython-contrib:masterfrom
jfbercher:toc2_basenumber
Feb 28, 2018
Merged

[toc2] basenumber#1252
jcb91 merged 1 commit intoipython-contrib:masterfrom
jfbercher:toc2_basenumber

Conversation

@jfbercher
Copy link
Copy Markdown
Member

@jfbercher jfbercher commented Feb 24, 2018

Enable to define a number to begin numbering with.
Useful to continue numbering over several chapters defined in separated notebooks. This should be preserved while exporting with jupyter nbconvert --to html_with_toc FILE or using toc2.tpl template. This addresses #1245 of @fmaussion

image

image

@fmaussion
Copy link
Copy Markdown

Thanks so much for looking into this!

I gave it a try, and it works partly for me:

  • there is no new option in the extension configuration tab: however, I added a "base_numbering": 2, option in the notebook's toc section manually for each file and this worked fine. Altogether I'm not sure to understand if a general option is the good way to do this, since this numbering is very notebook specific.
  • the rendering in the notebook is good:
    selection_019
  • however the rendering in html is strange: the ToC entry is fine, but the sidebar toc and the titles are still keeping their old numbering. See:
    selection_020

Maybe it's only me though (I don't know if I have to update something else after changing the code as you show in your PR).

@jfbercher
Copy link
Copy Markdown
Member Author

Sorry...
I mixed myself with the screenshots. First one was an attempt to change numbering by the nbextension configuration tab.
Actually, I ended with updating the base_number per notebook (click on the ToC settings icon on the toc window/sidebar) -- see below. I also update the PR description above.

image

@jfbercher
Copy link
Copy Markdown
Member Author

@fmaussion
Rendering after conversion loads the toc2.js in the github repo.
This will be only available after the PR is merged. This explains why the rendering in html in not fully updated (the toc2_cell is embedded in the notebook itself while the rest -- sidebar, numbering is computed by the toc2.js script)

@fmaussion
Copy link
Copy Markdown

Perfect, thanks! Looking forward to see this merged then ;-)

@fmaussion
Copy link
Copy Markdown

Any chance this can get merged before Sunday? If not it's OK, I'll just have to deal with it: my lecture starts next week and I can still use some workarounds for now.

@jcb91
Copy link
Copy Markdown
Member

jcb91 commented Feb 28, 2018

Looks good to me 👍

@jcb91 jcb91 merged commit 949e2a6 into ipython-contrib:master Feb 28, 2018
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

Successfully merging this pull request may close these issues.

3 participants