-
Notifications
You must be signed in to change notification settings - Fork 485
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
Towards a more flexible pages
interface
#2623
Comments
x-ref #344 |
Thanks! That seems to be incompatible with the current NavNode structure, see here: Documenter.jl/src/documents.jl Lines 236 to 241 in 6abd828
but I'm sure that with some effort we could fix that... |
Yeah if you're thinking about making it more flexible, this is something that people keep asking for. |
See also #701. |
Initial prototype up and running (pages but no external links or collapsing spec yet) - it just worked!! |
Documenter.jl/src/html/HTMLWriter.jl Line 1237 in 6abd828
|
In makedocs, the way to specify
pages
is currently pretty rigid - you can only pass in a very rigid nested array of strings (and indicate title / page path).I, and many others, would like to have a more flexible way to define pages for the sidebar, so that we can e.g. define a section header that is also a page / clickable, and has sub-pages associated with it. This is already possible in DocumenterVitepress although you have to define the sidebar manually in the config.mts. The basic DimensionalData docs is a good example - the "Getting started" is a page, but is also the section header for that section of the docs. There are also subsidiary pages.
Another example is choosing which subsections of the sidebar to expand on a more granular level. At the moment, we only have the ability to set a global threshold for the nesting level at which things collapse. But I may want a top level section to be collapsed by default, and a lower level section to not be collapsed.
There is some current functionality that is slightly similar, and that's
hide
- which takes anypages
-compatible structure / type, and returns a 4-tuple of(hidden::Bool, title::String, path::String, children::Vector)
(I think). So my first thought is that we should make this a struct that people can instantiate, and include some more metadata. A basic prototype might be (borrowing from Documenter.NavNode):Constructor
and then we can recursively parse all input to
pages
into PageNodes.@mortenpi mentioned that we could initially disallow collapsing pagenodes that have a non-nothing
page
but non-emptychildren
, pending a section collapser element in the UI.The main parser is in
walk_navpages
so that's where we have to inject the override.Documenter.jl/src/builder_pipeline.jl
Line 181 in 6abd828
cc: @mortenpi @fredrikekre
The text was updated successfully, but these errors were encountered: