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

Hiding notebooks on GitHub pages #434

Closed
kolibril13 opened this issue Jun 21, 2023 · 8 comments
Closed

Hiding notebooks on GitHub pages #434

kolibril13 opened this issue Jun 21, 2023 · 8 comments
Labels
story Feature request or idea to improve mystjs

Comments

@kolibril13
Copy link
Contributor

Which area is this feature request for?

Other

Describe the feature you'd like to request

I'm thinking of writing a physics script in mystjs and hosting it at https://kolibril13.github.io/myst-physics-script/
That works great so far!
Now, I'd like to hide the Jupyter notebook from the table of conent and only show the conent written in markdown.
Is this possible already?
I guess it has to do something with these lines in myst.yml , however I could not find a solution for that yet.
https://github.com/kolibril13/myst-physics-script/blob/main/myst.yml#L14-L16
Any help would be greatly appreciated :)

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

@kolibril13 kolibril13 added the story Feature request or idea to improve mystjs label Jun 21, 2023
@KyleTCL
Copy link

KyleTCL commented Jun 21, 2023

This is already possible, see here.

You have to explicitly include chapters by their path in the _toc.yml (see example in the link). Otherwise, make a hidden folder and put your notebook in the hidden folder, they should not be included.

@kolibril13
Copy link
Contributor Author

Hi @KyleTCL , thank you so much for this quick reply!
Indeed, that worked! :)

@rowanc1
Copy link
Member

rowanc1 commented Jun 21, 2023

Glad that works for you @kolibril13 -- thanks for your help @KyleTCL!

@kolibril13
Copy link
Contributor Author

Just played a bit more around with it, and @rowanc1, may I ask two more questions:

When I add only the _toc.ymlfile, I get the error `The table of contents defined in "_toc.yml" could not find file "index" defined as the "root:" page. Please ensure that one of these files is defined:

  • index.md
  • index.ipynb
  • index.tex
    `
  1. can I have a _toc.yml without an index file?
  2. When I create the index.md file, everything works fine. Is there a way I can have the table of content displayed in that index.md file? I could not find anything related to that on the docs.

@rowanc1
Copy link
Member

rowanc1 commented Jun 21, 2023

Always ask questions, happy to help out! :)

  1. Currently they need to have an index, this is what is loaded on the bare domain or project, my-site.com. The index page has a few special things that need to happen to it, which is why I think the JupyterBook _toc.yml spec treats it differently.
  2. Are you maybe thinking about a directive like toctree (in sphinx)? That is currently not implemented yet, keeping a list of these sorts of improvements here Audit of Features missing in JupyterBook #189.

@kolibril13
Copy link
Contributor Author

Hi Rowan, that's good to know, and yes, something like a toctree would be awesome to have!

And another thing I've noted: Now that the notebook is not any more present in the _toc.yml file, the linked assets are not shown on other pages anymore.
Is there a way I can still use the #| label: my-vid-embedded assets from the notebook in a myst chapter without including the notebook itself to the toc?
I think that would be an amazing feature!

@kolibril13
Copy link
Contributor Author

@rowanc1 One more observation:

Even when I have the notebook in the toc, the linking to labeled assets from the notebook on the static webpage does not work (It works though if I start the myst server with myst start).

chapters:
  - file: ./01-magnus.md
  - file: ./02-euler.md
  - file: ./media_notebook.ipynb

Linking on static webpages currently works only when I don't have the _toc file at all.

@kolibril13
Copy link
Contributor Author

...interesting, now it also does now work any more even on static pages without the _toc file.
I'll investigate this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
story Feature request or idea to improve mystjs
Projects
None yet
Development

No branches or pull requests

3 participants