Skip to content

Commit 697ceed

Browse files
authored
📚 DOCS: Add full documentation (#41)
1 parent fe379f0 commit 697ceed

File tree

19 files changed

+427
-26
lines changed

19 files changed

+427
-26
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ In normal Sphinx documentation, the documentation site-map is defined *via* a bo
1111

1212
This extension facilitates a **top-down** approach to defining the site-map structure, within a single YAML file.
1313

14-
![ToC graphic](toc-graphic.png)
14+
![ToC graphic](docs/toc-graphic.png)
1515

1616
It also allows for documents not specified in the ToC to be auto-excluded.
1717

docs/_toc.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
root: intro
2-
defaults:
3-
titlesonly: false
42
subtrees:
5-
- caption: Part 1
3+
- caption: User Guide
64
numbered: true
75
entries:
8-
- file: doc1
9-
- file: doc2
6+
- file: user_guide/sphinx
7+
- file: user_guide/cli
8+
- file: user_guide/api
9+
- caption: Example
10+
entries:
11+
- file: example/index
1012
entries:
11-
- file: subfolder/doc3
12-
- url: https://example.com
13-
title: Example Link
14-
- caption: Part 2
15-
numbered: true
13+
- file: example/subfolder/page
14+
- glob: example/globfolder/*
15+
- caption: Links
1616
entries:
17-
- glob: subglobs/glob*
17+
- title: GitHub Repository
18+
url: https://github.com/executablebooks/sphinx-external-toc

docs/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
# Configuration file for the Sphinx documentation builder.
1+
"""Configuration file for the Sphinx documentation builder."""
22

33
project = "Sphinx External ToC"
44
copyright = "2021, Executable Book Project"
55
author = "Executable Book Project"
66

77
extensions = ["myst_parser", "sphinx_external_toc"]
88

9+
myst_enable_extensions = ["colon_fence", "html_image"]
10+
911
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
1012
external_toc_exclude_missing = True
1113

1214
html_theme = "sphinx_book_theme"
15+
html_title = project
1316
html_theme_options = {
1417
"home_page_in_toc": True,
1518
"use_edit_page_button": True,

docs/doc1.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/doc2.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/example/globfolder/page1.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Sub-section Glob Page 1
2+
3+
A page added via globbing.

docs/example/globfolder/page2.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Sub-section Glob Page 2
2+
3+
Another page added via globbing.

docs/example/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Example Project
2+
3+
These pages provide an example of different aspects of the ToC.
4+
See this projects `_toc.yml` for how they are added.

docs/example/subfolder/page.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Sub-section Page
2+
3+
This is a page of a subsection.

docs/intro.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
# sphinx-external-toc [IN-DEVELOPMENT]
1+
# sphinx-external-toc
22

3-
A sphinx extension that allows the documentation toctree to be defined in a single YAML file.
3+
A sphinx extension that allows the documentation site-map (a.k.a Table of Contents) to be defined external to the documentation files.
44

5-
In normal Sphinx documentation, the documentation structure is defined *via* a bottom-up approach - adding [`toctree` directives](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#table-of-contents) within pages of the documentation.
5+
In normal Sphinx documentation, the documentation site-map is defined *via* a bottom-up approach - adding [`toctree` directives](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#table-of-contents) within pages of the documentation.
66

7-
This extension facilitates a **top-down** approach to defining the structure, within a single file that is external to the documentation.
7+
This extension facilitates a **top-down** approach to defining the site-map structure, within a single YAML file.
8+
9+
:::{figure-md}
10+
<img src="toc-graphic.png" alt="ToC graphic" width="600px" />
11+
12+
Example ToC
13+
:::
14+
15+
It also allows for documents not specified in the ToC to be auto-excluded.
816

917
```{tableofcontents}
1018
```

0 commit comments

Comments
 (0)