executablebooks / sphinx-external-toc

A sphinx extension that allows the site-map to be defined in a single YAML file
https://sphinx-external-toc.readthedocs.io
MIT License
33 stars 18 forks source link

✨ NEW: Add `tableofcontents` directive #11

Closed chrisjsewell closed 3 years ago

chrisjsewell commented 3 years ago

This is a re-working of https://github.com/executablebooks/jupyter-book/pull/757 (by @choldgraf and @AakashGfude), but improved since the replacement is made in the doctree-read phase (rather than a post transform) and so does not have to deal with any builder specific logic. Also better warnings and testing πŸ˜‰

Note, the current implementation does not wrap the toctrees in compound(classes=["tableofcontents-wrapper"]), like in jupyter-book, but I feel this is unnecessary

codecov[bot] commented 3 years ago

Codecov Report

Merging #11 (1251107) into main (10246dc) will increase coverage by 0.55%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #11      +/-   ##
==========================================
+ Coverage   88.92%   89.47%   +0.55%     
==========================================
  Files           5        5              
  Lines         325      342      +17     
==========================================
+ Hits          289      306      +17     
  Misses         36       36              
Flag Coverage Ξ”
pytests 89.47% <100.00%> (+0.55%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Ξ”
sphinx_external_toc/__init__.py 92.30% <100.00%> (+0.64%) :arrow_up:
sphinx_external_toc/events.py 88.88% <100.00%> (+1.49%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update 10246dc...1251107. Read the comment docs.