-
Notifications
You must be signed in to change notification settings - Fork 18
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
Initial Feedback #1
Comments
@ericholscher you might be able to help me with this: the RTD docs are building (https://readthedocs.org/projects/sphinx-external-toc/builds/) but the site says they do not exist: https://sphinx-external-toc.readthedocs.io 🤔 |
also cc @mgeier, since its an alternative to https://nbsphinx.readthedocs.io/en/0.8.2/subdir/toctree.html |
Thanks for cc-ing! I like having the But I guess if somebody wants to use it, the external TOC extension would work just as well with Jupyter notebooks and |
Yes indeed, the core extension is input format agnostic (modifying the parsed AST) 👍 |
Thank you @chrisjsewell
Is there a case when |
yeh you could potentially have: root: intro
sections:
- file: doc1
- file: doc2 which is also equivalent to: root: intro
parts:
- sections:
- file: doc1
- file: doc2 but would just want to think if this "clutters" the top-level namespace or restricts addition of later keys |
now changed and the initial comment edited |
A couple quick thoughts:
|
Thanks for the comments @choldgraf
Note
Exactly we should choose one, otherwise its misleading in that it implies a difference between the two, and is more for users to understand/remember.
No its |
Ah I figured out this issue; it is because the root/master_doc is set as Should/has this been opened as a bug on sphinx, that if Anyhow, I guess this relates to my comment here: https://github.com/executablebooks/jupyter-book/pull/1293/files#r610150939, such that this logic should be moved here, and if |
Found an RTD issue for it: readthedocs/readthedocs.org#1800 |
thanks @chrisjsewell on this work. This is a great idea. I just had a few comments
Are Alternatively @chrisjsewell would this extension allow:
We could then develop a mapping from the
Just one comment re |
Regarding chapters/sections/main/root, I personally think there are downsides to aliases
|
Yes I'm completely against aliases as well, it just makes things more confusing. When I tried to read the documentation on the toc on jupyter-book, it was honestly super-confusing and not clear at all when to use
See @mmcky even you don't understand the current structure lol, because this is definitely incorrect/outdated: there is no
If I am over-ruled by consensus fair enough, but I think it is very easy/clear to explain that which I think would make it much clearer, and actually give users this mental model that you guys keep alluding to but never showing 😜 |
I could even add this |
Looking at @chrisjsewell excellent visualization, what comes to my mind is that if there's a naming change that would help me get the right mental model, it would be renaming EDIT: On second thought, I don't like this idea. Don't listen to me 😄 |
haha yeh I was just typing:
I would be hesitant, because (a) it takes it further away from the current jupyter-book toc.yml and (b) maybe it fells a bit weird to have a |
hey @chrisjsewell this _toc.yml uses the I am all for a general structure for organising the FWIW - I am also against I think the way forward would be to enable a |
one quick note
It doesn't use the |
Then you/we need to come up with some code/logic to deal with this. Thinking about it now, as you allude to, the current index.rst Index Title
===========
.. toctree::
:caption: Caption
doc1 + doc1.rst Doc 1 Title
===========
.. toctree::
doc2 + doc2.rst Doc 2 Title
===========
to \part{Caption}
\chapter{Doc 1 Title}
\section{Doc 2 Title} (see https://github.com/executablebooks/jupyterbook-latex/blob/master/tests/roots/test-partsToc -> https://github.com/executablebooks/jupyterbook-latex/blob/master/tests/test_toc/test_toc.tex) This is most definitely not always the case:
If I use the default sphinx LaTeX theme, then it creates: \addto\captionsenglish{\renewcommand{\contentsname}{Caption}}
\chapter{Doc 1 Title}
\section{Doc 2 Title} or if I set \addto\captionsenglish{\renewcommand{\contentsname}{Caption}}
\part{Doc 1 Title}
\chapter{Doc 2 Title} (I assume @mmcky/@AakashGfude have added something in jupyterbook-latex to turn the toctree captions into parts?)
Index Title
===========
Index Sub-Header
----------------
.. toctree::
:caption: Caption
doc1 and \addto\captionsenglish{\renewcommand{\contentsname}{Caption}}
\part{Index Sub-Header}
\chapter{Doc 1 Title}
\section{Doc 2 Title} So actually I would be in favour of moving away from using these key names for the general structure, which can be misleading, to something like:
Then OK you can think of having some kind of "theme specific mapping" (maybe specified under a
Ideally here, you should also warn of things that would make this mapping incorrect e.g. if the
|
jupyterbook-latex uses Also the
Effectively any nested documents is a So
In
@chrisjsewell I like the idea of having a But I think the When working on LaTeX we have been using a mixture of Thanks @chrisjsewell -- I see a |
thanks @mmcky
Well no, not if it does not contain a
This construct is also completely independent of the key names in the actual YAML, e.g. if len(env.external_site_map.root.subtrees) > 1: and I would emphasize again that your interpretation of a part and a chapter in jupyterbook-latex are predicated on the assumption that there are no sub-headings in the root/master document (otherwise everything gets "pushed down"), so I would certainly check for and warn about additional |
hey @chrisjsewell I have come to realise this is So we will need to either:
Is that right? |
Kind of, there's really no difference to what jupyter-book already does, it's just the decision about key-names, which is essentially entirely superficial as it does not affect the underlying API/AST
again I would emphasise that jupyter-book, or its components (like jupyterbook-latex) should not even assume the existence of a |
Ok this is good to go in my eyes: See the README (and commit history) for all details. Then for @mmcky's request for "domains" there is the You can see the jupyter-book migrations in the test files: and also you can see the diffs in https://github.com/executablebooks/jupyter-book/pull/1293/files and so basically for jupyter-book format: jb-article
root: index
sections:
- file: subfolder/index
sections:
- file: subfolder/asubpage1
- file: content1 or format: jb-book
root: index
chapters:
- file: subfolder/index
sections:
- file: subfolder/asubpage1
- file: content1 or format: jb-book
root: index
parts:
- caption: A part
chapters:
- file: subfolder/index
sections:
- file: subfolder/asubpage1
- caption: Another part
chapters:
- file: content1 |
This is looking really neat @chrisjsewell - thanks for your work on support for I just had a few follow up comments.
format: article
title: <text>
introduction: <file>
section: <file>
section: <file>
section: <file>
conclusion: <file> and for format: book
title: <text>
frontmatter: <file>
toc: true
chapter: <file>
chapter: <file>
chapter: <file>
appendix: <file> I think these |
I'm not quite sure I quite understand this sentence lol.
Well first you would need to define how such formats would be implemented by sphinx? |
Hey all - I gave the docs another read-through, and had a few ideas / comments. Will append to this list as I think of more. In general this is super close though, it looks really nice:
|
yeh it was introduced as an alias in v4: sphinx-doc/sphinx#9116 |
ok those issues are the main ones that I can think of - I opened them up as separate issues because this mega-thread was becoming difficult to follow. I welcome thoughts and feedback from folks 👍 |
Right. I just mean in the
Right -- that's what I am thinking (or replacing the |
exactly, so this is obviously functionality that does not currently exist in sphinx or jupyter-book, but could certainly be investigated and likely the code would reside in this package and be accomodated by specifying a new But yeh definitely a "version 2" consideration 😉 |
closing this, since the package is now out of development |
This implements executablebooks/meta#292
Everything should be documented in the README (and what is left TODO)
The
_toc.yml
differs slightly from the one in https://jupyterbook.org/customize/toc.html, to streamline it a bit (a conversion function can be written for migration):defaults are specified under a separate
defaults
top-level key, rather under the first documenttitlesonly
is not set toTrue
by defaultThe toc is always heirarchical, i.e.
would now be:
Its a little more verbose, for these very simple tocs, but removes ambiguity, maps more closely to sphinx toctrees and is easier to explain/understand.
removed
chapters
key, as it seems redundant, i.e. onlyparts
(->toctree
directives in a document) andsections
(-> lines in atoctree
) are necessary to generate any sphinx site map.changed(changed this back, so as not to deviate unnecessarily)file
todoc
cc @choldgraf, @AakashGfude, @mmcky, @ericholscher, @pradyunsg, @hukkinj1 for comment
The text was updated successfully, but these errors were encountered: