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

Use custom format file as parent in nested TOC #1064

Closed
lesteve opened this issue Oct 30, 2020 · 3 comments · Fixed by #1293
Closed

Use custom format file as parent in nested TOC #1064

lesteve opened this issue Oct 30, 2020 · 3 comments · Fixed by #1293
Labels
enhancement New feature or request 🏷️ toc An issue related to the toc structure

Comments

@lesteve
Copy link

lesteve commented Oct 30, 2020

Is your feature request related to a problem? Please describe.

We are using .py files as custom notebook format as described in https://jupyterbook.org/file-types/jupytext.html#file-types-custom.

I bumped recently into the limitation that you can not to use custom format notebook as parent in the TOC, i.e. if you have a TOC like this

- file: index

- part: The Predictive Modeling Pipeline
  chapters:
  - file: python_scripts/02_numerical_pipeline
    sections:
      - file: python_scripts/02_numerical_pipeline_ex_01

you will get the error Only markdown, ipynb, and rst files are supported in the TOC.

Note this only happens if there is nested sections, so this TOC works fine:

- file: index

- part: The Predictive Modeling Pipeline
  chapters:
  - file: python_scripts/02_numerical_pipeline

Describe the solution you'd like

This is not a show-stopper but being able to use custom notebook format as parent in the TOC would be nice. I would be curious to know whether there is some inherent difficulty in tackling this edge case or whether it is more that nobody has asked about it (until now 😉).

Additional context

To reproduce the problem (in case it helps):

git clone https://github.com/lesteve/scikit-learn-mooc --branch custom-file-toc-limitation
cd scikit-learn-mooc/jupyter-book
jb build .
@lesteve lesteve added the enhancement New feature or request label Oct 30, 2020
@welcome
Copy link

welcome bot commented Oct 30, 2020

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! 🎉

@choldgraf
Copy link
Member

oops - yep that should be fixable, I think we want to add a check for the "custom notebook formats" here:

https://github.com/executablebooks/jupyter-book/blob/master/jupyter_book/toc.py#L144

@chrisjsewell chrisjsewell added enhancement New feature or request 🏷️ toc An issue related to the toc structure and removed enhancement New feature or request labels Apr 8, 2021
@chrisjsewell
Copy link
Member

In #1293 there will no longer be this restriction on source format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 🏷️ toc An issue related to the toc structure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants