-
Notifications
You must be signed in to change notification settings - Fork 571
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
Add a toc for html and latex exporter #2178
Open
HaudinFlorence
wants to merge
29
commits into
jupyter:main
Choose a base branch
from
HaudinFlorence:add_exporter_for_html_toc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+222
−219
Open
Changes from 15 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
fafa016
Add a function to extract the titles and levels of headings from the …
HaudinFlorence e364a11
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f7eb4c4
Updates jinja templates.
HaudinFlorence fab3c55
Update jinja templates and add style to the table of contents.
HaudinFlorence 81e7e6c
Add links to be able to go to the relevant sections when clicking on …
HaudinFlorence 04011ea
Place the css inline in index.html.j2.
HaudinFlorence 0d02f38
Remove index.css from the git index.
HaudinFlorence 05f6f11
Add the include_tableofcontents traitlet and update the jinja templat…
HaudinFlorence 5f26a5c
Add the logics to include a table of contents for the latex exporter.
HaudinFlorence 37485ef
Update nbconvertapp with removing toc from alias and with adding toc …
HaudinFlorence d5b579f
Try to fix failing CI tests.
HaudinFlorence 6a5f4cb
Try to fix pre-commit test.
HaudinFlorence b31a287
Try to fix failing linting test.
HaudinFlorence cb90485
Update markdown.mistune.py and add docstrings to get 100% as a score …
HaudinFlorence b4d7e3d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 28089fa
Apply suggestions from code review
HaudinFlorence 9720c29
Apply other suggestions from code review.
HaudinFlorence f88620e
Fix linting issues.
HaudinFlorence c8483f8
Try to fix failing linting test.
HaudinFlorence 711cee8
Try to remove None check condition.
HaudinFlorence cdc2743
Restore None check condition in HTML exporter instead of _init_resources
HaudinFlorence de2ff4e
Change method extract_titles_from_markdown_input to extract_titles_fr…
HaudinFlorence 6fbb968
Update extract_titles_from_notebook_node to fix some parsing issues.
HaudinFlorence 5708233
Try to fix failing tests.
HaudinFlorence 14a3ab8
Remove condition on headers of level 1.
HaudinFlorence e833379
Update extract_titles_from_notebook_node.
HaudinFlorence e5d2da6
Change the logics to get the headers using parsing of the markdown ce…
HaudinFlorence 40f971d
Add sysmetically an id to the headers to be sure to have a defined href.
HaudinFlorence 8c66634
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it would better having this in
_init_resources
as this is the place where we initialize the resourcesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment. This has been moved to
_init_resources.
But this is probably not inducing the proper checking onresources
not beingNone
since it is breaking again the linting CI test with this type of errorThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using
update
, you could follow what the rest of the code is doing:resources["tableofcontents"] = extract_titles_from_markdown_input(markdown_collection)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was initially what was used but without any check that
resources
was notNone
.Introducing the suggested change leads to this error message
Maybe the type check in the
_init_resources
function is not valid.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have displaced the
None check
condition back at its initial place, in theHTMLExporter