-
Notifications
You must be signed in to change notification settings - Fork 806
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
TOC2: start h1 numbering at a predefined counter #1245
Comments
Hmm. So if I understand correctly you want the h1 heading in a notebook to be say number 2, because it follows an h1 in another notebook? I don't think there is a way to do this so far, but I expect it would be relatively easy to implement as a feature the ability to manually set the starting number, if it'd be useful... |
Thanks for the quick reply! Yes, I would find it very useful indeed. But I'm not familiar at all with the development of nbextensions so I'm afraid I can't really help :( |
Actually, now that I think of it a bit more, the easiest way for this kind of structure might be to skip h1 headers altogether (which is already an option as I can see). I still think this would be a useful feature but maybe you don't have to put it on top of your priority list... |
For the context: I use toc2 essentially for it's ability to generate TOCs automatically, then use bookbook to generate html outputs. The problems I see with the numbering is that since the titles are not automatically numbered in the html output, the toc is the only listing containing section numbers. Since I guess this is not something easily done on the TOC2 side, I might skip numbering altogether... |
Do you mean something like that?
|
In an ideal world, I would like to have the following feature: In the notebooks:
Rendered in html output as:
Sorry if it's not clear, it's difficult to describe ;) |
Just see the two last comments. a) I see what you want for numbering
before L567 in
in the MyHTMLExporter definition of (your version of) file html.py in the bookbook package |
Thanks a lot for your help! Starting with problem
Replacing |
This shall also be added in from traitlets.config import Config
@property
def default_config(self):
c = Config()
# import here to avoid circular import
from jupyter_contrib_nbextensions.nbconvert_support import (
templates_directory)
c.merge(super(MyHTMLExporter, self).default_config)
c.TemplateExporter.template_path = [
'.',
templates_directory(),
]
return c |
Brilliant! Worked like a charm, thanks a lot. Will talk with the developer of bookbook in order to add this option to the project. For problem |
Closed via #1252 |
Sorry if this has been asked before: is there a way to start the numbering of the
h1
level at any other number than 1?I'd like to do so because my h1 headers are titles of "chapters", as defined by the bookbook tool.
The text was updated successfully, but these errors were encountered: