Skip to content
Snippets Groups Projects
Commit 4f2a2a19 authored by Chris Sewell's avatar Chris Sewell
Browse files

update to sphinx-external-toc==0.1.0a7

parent 73c44afd
No related branches found
No related tags found
No related merge requests found
Showing
with 74 additions and 74 deletions
- file: intro
- part: Tutorials
format: jb-book
root: intro
parts:
- caption: Tutorials
chapters:
- file: start/your-first-book
sections:
......@@ -10,8 +11,7 @@
- file: start/publish
- file: tutorials/references
- file: basics/questions
- part: Create your book
- caption: Create your book
chapters:
- file: customize/toc
- file: basics/create
......@@ -28,13 +28,12 @@
- file: interactive/hiding
- file: file-types/index
sections:
- file: file-types/markdown
- file: file-types/notebooks
- file: file-types/myst-notebooks
- file: file-types/jupytext
- file: file-types/restructuredtext
- part: Build your book
- file: file-types/markdown
- file: file-types/notebooks
- file: file-types/myst-notebooks
- file: file-types/jupytext
- file: file-types/restructuredtext
- caption: Build your book
chapters:
- file: basics/build
- file: execute/index
......@@ -43,8 +42,7 @@
- file: content/execute
- file: interactive/interactive
- file: basics/page
- part: Publish your book
- caption: Publish your book
chapters:
- file: publish/web
sections:
......@@ -56,24 +54,20 @@
sections:
- file: interactive/comments/hypothesis
- file: interactive/comments/utterances
- file: advanced/html
- file: advanced/pdf
- part: Advanced usage
- caption: Advanced usage
chapters:
- file: advanced/sphinx
- file: advanced/windows
- file: explain/sphinx
- part: Reference
- caption: Reference
chapters:
- file: customize/config
- file: reference/cheatsheet
- file: reference/cli
- file: reference/glossary
- part: About Jupyter Book
- caption: About Jupyter Book
chapters:
- url: https://executablebooks.org/en/latest/gallery.html
title: Gallery of Jupyter Books
......
......@@ -17,7 +17,7 @@ For example: `jupyter-book build mybook/` is equivalent to ``jb build mybook/``.
**See below for the full command-line reference**
```{eval-rst}
.. click:: jupyter_book.commands:main
.. click:: jupyter_book.cli.main:main
:prog: jupyter-book
:nested: full
```
# Table of contents
# Learn more at https://jupyterbook.org/customize/toc.html
- file: intro
format: jb-article
root: intro
sections:
- file: markdown
- file: notebooks
......@@ -2,12 +2,11 @@
import os.path as op
import sys
from pathlib import Path
from typing import Optional, Union
from typing import Union
from sphinx.application import Sphinx
from sphinx.cmd.build import handle_exception
from sphinx.util.docutils import docutils_namespace, patch_docutils
from sphinx_external_toc.api import SiteMap
from .config import get_final_config
from .pdf import update_latex_documents
......@@ -150,15 +149,6 @@ def build_sphinx(
app.build(force_all, filenames)
# Write an index.html file in the root to redirect to the first page
# TODO when would this be required?
path_index = outputdir.joinpath("index.html")
site_map: Optional[SiteMap] = getattr(app.env, "external_site_map", None)
if not path_index.exists() and site_map:
first_page = site_map.root.docname.split(".")[0] + ".html"
with open(path_index, "w", encoding="utf8") as ff:
ff.write(REDIRECT_TEXT.format(first_page=first_page))
return app.statuscode
except (Exception, KeyboardInterrupt) as exc:
......
......@@ -77,7 +77,7 @@ setup(
"nbconvert<6",
'importlib_metadata; python_version < "3.7"',
"jsonschema",
"sphinx-external-toc==0.1.0a5",
"sphinx-external-toc==0.1.0a7",
"sphinx_togglebutton",
"sphinx-copybutton",
"sphinx-comments",
......
format: jb-article
root: index
defaults:
titlesonly: true
format: jb-article
root: index
defaults:
titlesonly: true
format: jb-article
root: index
defaults:
titlesonly: true
format: jb-article
root: source/index
defaults:
titlesonly: true
sections:
- file: source/content
sections:
......
format: jb-article
root: intro
defaults:
titlesonly: true
sections:
- file: contents/markdown
format: jb-article
root: index
title: Toc
defaults:
titlesonly: true
format: jb-article
root: index
title: Toc
defaults:
titlesonly: true
sections:
- file: content1
title: Content1
......
format: jb-book
root: index
title: Toc
parts:
- caption: A section
chapters:
- file: subfolder/index
title: Subfolder
sections:
- file: subfolder/asubpage1
title: Asubpage 1
- caption: Another section
chapters:
- file: content1
title: Content1
sections:
- file: subfolder/asubpage2
title: Asubpage 2
- file: content2
title: Content2
sections:
- file: subfolder/asubpage3
title: Asubpage 3
- file: content3
title: Content3
sections:
- file: subfolder/asubpage4
title: Asubpage 4
format: jb-book
root: index
title: Toc
defaults:
titlesonly: true
parts:
- caption: Empty chapter
- caption: A section
sections:
chapters:
- file: content1
title: Content1
- file: subfolder/index
......@@ -14,7 +13,7 @@ parts:
- file: subfolder/asubpage
title: Asubpage
- caption: Another section
sections:
chapters:
- file: content2
title: Content2
- file: content3
......
format: jb-article
root: index
defaults:
titlesonly: true
title: Toc
sections:
- file: content1
......
format: jb-book
root: index
title: Toc
defaults:
titlesonly: true
parts:
- caption: A section
sections:
chapters:
- file: content1
title: Content1
- file: subfolder/index
......@@ -14,7 +13,7 @@ parts:
title: Asubpage
- title: My title without URL
- caption: Another section
sections:
chapters:
- file: content2
title: Content2
- file: content3
......
format: jb-book
root: index
title: Toc
defaults:
titlesonly: true
options:
numbered: true
sections:
chapters:
- file: content1
title: Content1
- file: subfolder/index
......
format: jb-book
root: index
title: Toc
defaults:
titlesonly: true
options:
numbered: 1
sections:
chapters:
- file: content1
title: Content1
- file: subfolder/index
......
format: jb-book
root: index
title: Toc
defaults:
titlesonly: true
parts:
- caption: Chapter 1
numbered: true
sections:
chapters:
- file: content1
title: Content1
- caption: Chapter 2
sections:
chapters:
- file: content2
title: Content2
- file: content3
title: Content3
- caption: Chapter 3
numbered: 1
sections:
chapters:
- file: subfolder/index
title: Subfolder
sections:
......
format: jb-book
root: index
title: Toc
defaults:
titlesonly: true
parts:
- caption: Chapter 1
numbered: true
sections:
chapters:
- file: content1
title: Content1
- file: subfolder/index
......@@ -15,7 +14,7 @@ parts:
title: Asubpage
- caption: Chapter 2
numbered: true
sections:
chapters:
- file: content2
title: Content2
- file: content3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment