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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 FIX: fixing toctree spacing bug #836

Merged
merged 1 commit into from
Aug 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions jupyter_book/toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,9 @@ def add_toctree(app, docname, source):
toctrees.append(_gen_toctree(toc_options, toc_sections, parent_suff))
toctrees = "\n".join(toctrees)

# Figure out what kind of text defines a toctree directive for this file
# currently, assumed to be markdown
# Now modify the source file with the new toctree text
if parent_suff in [".md", ".rst"]:
source[0] += toctrees + "\n"
source[0] += "\n\n" + toctrees + "\n" # Add two \n to ensure no clash w/ text
elif parent_suff == ".ipynb":
# Lazy import nbformat because we only need it if we have an ipynb file
import nbformat as nbf
Expand Down