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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ NEW: Adding - chapter entries to _toc.yml #817

Merged
merged 5 commits into from
Jul 28, 2020

Conversation

choldgraf
Copy link
Collaborator

@choldgraf choldgraf commented Jul 28, 2020

This adds support for - chapter: entries in _toc.yml. It re-works how the TOCtrees are build from _toc.yml. We now allow for two ways to create your sections:

  1. Using a flat list of - file: entries
  2. Using explicit chapters w/ groups of files with - chapter: entries.

I still need to update the tests to use this new structure, but want to know if folks think this looks satisfactory.

deprecates:

  • the header: option in _toc.yml. If you want headers, you should now use - chapter: My title groupings.
  • controlling numbered: true directly on files. If you wish to specify that single file / group of files are numbered, do so via - chapter: groupings.

✨ See new docs for this behavior here

closes #783

The following release notes are used in our tests to make sure they work properly!

Release notes

Here's an example of the TOC structure:

- file: intro
  numbered: true

- chapter: Get started
  sections:
  - file: start/overview
  - file: start/build

- chapter: Book pages and types
  sections:
  - file: content/markdown
  - file: content/notebooks

- chapter: Reference and test pages
  sections:
  - file: test_pages/test
    sections:
      - file: test_pages/layout_elements
      - file: test_pages/equations

@codecov
Copy link

codecov bot commented Jul 28, 2020

Codecov Report

Merging #817 into master will increase coverage by 2.11%.
The diff coverage is 97.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #817      +/-   ##
==========================================
+ Coverage   82.51%   84.62%   +2.11%     
==========================================
  Files           8        8              
  Lines         669      657      -12     
==========================================
+ Hits          552      556       +4     
+ Misses        117      101      -16     
Flag Coverage Δ
#pytests 84.62% <97.50%> (+2.11%) ⬆️

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

Impacted Files Coverage Δ
jupyter_book/toc.py 93.82% <97.50%> (+8.76%) ⬆️

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 7eb3d27...0d5ef49. Read the comment docs.

@choldgraf
Copy link
Collaborator Author

OK I'm gonna merge this one in so that we can have time to try it out on master 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use - chapter: top-level sections in the _toc.yml file
1 participant