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

h2 (##) vs h1 (#) headers #36

Closed
hannorein opened this issue May 1, 2021 · 3 comments
Closed

h2 (##) vs h1 (#) headers #36

hannorein opened this issue May 1, 2021 · 3 comments

Comments

@hannorein
Copy link
Contributor

hannorein commented May 1, 2021

Thanks for writing this plugin! Exactly what I needed.

After reading the readme file, I can see that headers in a Jupyter notebook need to be h2 and not h1 to show up in the TOC. But I wonder why? Where is this limitation coming from and is there a way to change that? I'd like to avoid having to go through all my ipynb files to increasing the heading levels.

@danielfrg
Copy link
Owner

Yes, thats a "limitation" on how mkdocs handles the TOCs, we dont do anything special on this plugin just read the headers and pass them to mkdocs. Agree thats a bit annoying I have manually changed a lot of those for my docs :S

@hannorein
Copy link
Contributor Author

Ah. That makes sense. Thanks.

One more related question since I have you here: would it make sense to set the title attribute of the mkdoc page object to whatever nbconvert chooses as the title? I think that would be the first h1 header that appears in the file in most cases. Unless I'm missing something, mkdocs-jupyter is currently not setting any title attribute. So if I want to have a title that is different from the filename, I need to specify it manually when setting up the navigation.

@danielfrg
Copy link
Owner

Yes, I have noticed that. I am how that can be fixed but there must be a way, would you create another issue for that?

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

2 participants