Navbar section numbering only renders on local build, not on web deploy
See original GitHub issueDescribe the bug
In our Jupyter Book’s _config.yml
file, we set navbar_number_sections : true
in line 17 in order to put ascending numbers on each chapter in the left-side navbar. When we compile the Jupyter Book on a local machine, the chapter numbers look as expected (see first figure below). But when we commit those changes to the book’s repository through pull request, the navbar chapter numbers do not render on the deployed GitHub page (see second picture below).
To Reproduce Steps to reproduce the behavior:
- Fork the book repository at https://github.com/PSLmodels/Git-Tutorial
- Navigate to the
Git-Tutorial
top-level directory of the repository. - Create and activate the
conda
environment using the following commands in your terminal.
$ conda env create -f environment.yml
$ conda activate jb-git-tutorial
- Run the following command from your terminal to build the book.
$ jb build ./book
Expected behavior
When we look at the compiled html intro page of the book on the local machine by opening the file ./_build/html/index.html
in a Google Chrome browser, the left-side navbar looks as expected. I’ve circled in red the navbar chapter numbers we expected.
However, when we commit this code to our book’s GitHub repository https://github.com/PSLmodels/Git-Tutorial, the updates are automatically compiled and deployed to the GitHub pages site https://pslmodels.github.io/Git-Tutorial/ for the repository, and the navbar looks like the following image, which does not have the chapter numbers. I have circled in red the area where the navbar numbers are supposed to be and where they appeared in the local build described previously.
Environment (please complete the following information):
Our book’s environment is specified in environment.yml
- Python Version is
python>=3.7.4
, but in practice I think it ispython=3.8.3
- Output of
jupyter-book --version
. In the environment.yml, we specifyjupyter-book>=0.7.1. The output of
jupyter-book --version` is the following:
Jupyter Book: 0.7.1
MyST-NB: 0.8.4
Sphinx Book Theme: 0.0.29
MyST-Parser: 0.9.0
Jupyter-Cache: 0.2.2
Additional context
I am on the leadership council of the PSLmodels (Policy Simulation Library Models) organization and on the steering committee of QuantEcon. Our GitHub organization for incubating and catalogued open source policy models is https://github.com/PSLmodels. We are moving all of our documentation for all PSL-catalogued models to jupyter-book
. Examples are Tax-Calculator, OG-USA, and Git-Tutorial (the subject of this e-mail). We are currently incorporating GitHub Actions to deploy the jupyter-book
GitHub pages upon commits to master, and the OG-USA jupyter-book
documentation incorporates the Sphinx docstring scraping for the model API documentation and also deploys upon commits to master. Any help you can give us on these questions to improve our jupyter-book
documentation will go immediately into our documentation. Thanks for such a great package.
cc: @jdebacker, @MaxGhenis, @jstac
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
@rickecon the resetting of numbering should be fixed after merging this PR https://github.com/executablebooks/jupyter-book/pull/1248. Possibly in the next
jb
release.@choldgraf Thanks for all your help on this. Yes, this seems to be similar to the question in #809.