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

Numbered wrong when migrating from jupyter-book to Sphinx #108

Open
luweizheng opened this issue Dec 20, 2023 · 5 comments
Open

Numbered wrong when migrating from jupyter-book to Sphinx #108

luweizheng opened this issue Dec 20, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@luweizheng
Copy link

Describe the bug

context
I have built a site with jupyter-book successfully. Now I want to use the features of sphinx-book-theme so I migrate from jupyter-book to sphinx.

I use the generated conf.py with

extensions = ['sphinx_external_toc',]
external_toc_exclude_missing = True
external_toc_path = '_toc.yml'

and my _toc.yml remains the same like:

format: jb-book
root: index
parts:
  - caption: 引言
    numbered: true
    chapters:
    - file: ch-intro/index
      sections:
        - file: ch-intro/computer-architecture
        - file: ch-intro/thread-process
  
  - caption: Dask
    numbered: true
    chapters:
    - file: ch-dask/index
      sections:
        - file: ch-dask/dask-intro

But it turns out that it cannot continue numbers between different chapters.

image

Reproduce the bug

What do I need to do to fix this issue?

List your environment

sphinx_external_toc 0.3.1
sphinx-multitoc-numbering 0.1.3

@luweizheng luweizheng added the bug Something isn't working label Dec 20, 2023
Copy link

welcome bot commented Dec 20, 2023

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@luweizheng
Copy link
Author

I use a workaround to fix this issue:

root: index
subtrees:
- numbered: true
  entries:
  - file: ch-intro/index
    entries:
    - file: ch-intro/computer-architecture
    - file: ch-intro/thread-process
  - file: ch-dask/index
    entries:
    - file: ch-dask/dask-intro

The UI is slightly different now:

image

@mmcky
Copy link
Member

mmcky commented Dec 20, 2023

Nice workaround @luweizheng. Sorry for the delay in commenting on this.

I suspect the main issue with the first configuration is you would need to add numbered: true to the top level configuration (rather than add it to each part as the numbering resets).

https://sphinx-multitoc-numbering.readthedocs.io/en/latest/#jupyter-book-example

@luweizheng
Copy link
Author

Nice workaround @luweizheng. Sorry for the delay in commenting on this.

I suspect the main issue with the first configuration is you would need to add numbered: true to the top level configuration (rather than add it to each part as the numbering resets).

https://sphinx-multitoc-numbering.readthedocs.io/en/latest/#jupyter-book-example

Thanks for you reply!

The conf in sphinx-multitoc-numbering is a little bit different from sphinx-external-toc. sphinx-external-toc's doc does not have part keyword.

@luweizheng
Copy link
Author

Hi @mmcky

Are there any solutions? sphinx-external-toc's doc does not have part keyword.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants