-
Notifications
You must be signed in to change notification settings - Fork 691
♻️ REFACTOR: Delegate ToC logic to sphinx-external-toc #1293
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
bd28cd4
♻️REFACTOR: Delegate ToC logic to sphinx-external-toc
chrisjsewell 7bd99e1
update sphinx-external-toc==0.1.0a3
chrisjsewell eb93259
rework some tests
chrisjsewell ec31225
update to sphinx-external-toc==0.1.0a5
chrisjsewell 73c44af
Merge branch 'master' into sphinx-external-toc
chrisjsewell 4f2a2a1
update to sphinx-external-toc==0.1.0a7
chrisjsewell a1701f2
uncomment test_toc.py
chrisjsewell e265670
uncomment tocdirective tests
chrisjsewell c28e6a7
add test debug
chrisjsewell e964985
debug
chrisjsewell c86266b
update to sphinx-external-toc==0.1.0a8
chrisjsewell acc540f
Merge branch 'master' into sphinx-external-toc
chrisjsewell 96d2de5
⬆️ UPDATE: pinning of sphinx-book-theme to ~=0.1.0
chrisjsewell e48f20c
⬆️ UPDATE: jupyterbook-latex==0.2.1a1
chrisjsewell 947b6c0
[TEMP] Apply less stringent waitUnitl condition for pyppeteer rendering
mmcky 5046976
Merge branch 'master' into sphinx-external-toc
mmcky 3d83585
update versions
chrisjsewell d8a376f
fix test
chrisjsewell abb74c0
update to 0.11.0a1 for release
chrisjsewell 8595fe8
jupyterbook-latex~=0.3.0
chrisjsewell 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ coverage.xml | |
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
*_build | ||
_build | ||
|
||
|
||
# Translations | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
"""Build a book with Jupyter Notebooks and Sphinx.""" | ||
from pathlib import Path | ||
|
||
from .toc import add_toc_to_sphinx, add_toctree | ||
from .directive.toc import TableofContents, SwapTableOfContents | ||
from sphinx.util import logging | ||
|
||
|
||
__version__ = "0.10.2" | ||
__version__ = "0.11.0a1" | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
@@ -25,25 +22,10 @@ def add_static_files(app, config): | |
# We connect this function to the step after the builder is initialized | ||
def setup(app): | ||
|
||
# Updates `master_doc` using the first item of `_toc.yml` | ||
app.connect("config-inited", add_toc_to_sphinx) | ||
|
||
# Add toctrees to each content page using `_toc.yml` | ||
app.connect("source-read", add_toctree) | ||
|
||
# Path for `_toc.yml` | ||
app.add_config_value("globaltoc_path", "toc.yml", "env") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all this red is a beautiful thing |
||
app.add_config_value("use_jupyterbook_latex", True, "env") | ||
|
||
# Add custom static files to the sphinx build | ||
app.connect("config-inited", add_static_files) | ||
|
||
# Directives | ||
app.add_directive("tableofcontents", TableofContents) | ||
|
||
# Transforms | ||
app.add_post_transform(SwapTableOfContents) | ||
|
||
# Extensions | ||
return { | ||
"version": __version__, | ||
|
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# Table of contents | ||
# Learn more at https://jupyterbook.org/customize/toc.html | ||
|
||
- file: intro | ||
format: jb-article | ||
root: intro | ||
sections: | ||
- file: markdown | ||
- file: notebooks |
File renamed without changes.
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.
Maybe we wanna call this
title:
rather thancaption:
? I know that Sphinx calls it caption but I feel like "title" will be more intuitive for peopleThere 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.
eurgh maybe, but it will mean additonal code/complexity needs to be implemented in
sphinx-external-toc
, to map toctree options to different keysThere 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.
Ah i thought it would already work, in that case let's leave this to a future enhancement to discuss