-
Notifications
You must be signed in to change notification settings - Fork 337
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
Two levels of nesting in reference index #327
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
FYI, another example of where multi-level nesting in reference index has been helpful. Our DLMtool package has a large number of functions that belong to distinct categories. I added some dodgy hacks to My hacked code has since broken with updates to pkgdown which is of course to be expected. |
@jayhesselberth this seems like it might be worth revisiting now that we have a better TOC in the sidebar. |
For keras, a second natural level could be for "Layers". Easiest way to implement would be to add a "group" section and nest titles under that. Groups would be assigned h2 and titles would get h3. reference:
- group: "Layers"
- title: "Core Layers"
contents:
- layer_input
...
- title: "Convolutional Layers"
contents:
- starts_with("layer_conv_")
... Need to think about how this would work if no groups were specified, or if there were a mixture of groups with titles and just bare titles not associated with a group. |
Maybe we could say that reference:
- title: "Layers"
contents:
- title: "Core Layers"
contents:
- layer_input
...
- title: "Convolutional Layers"
contents:
- starts_with("layer_conv_")
... |
That would be a bit easier to work with if we used something other than reference:
- section: "Layers"
contents:
- title: "Core Layers"
contents:
- layer_input
...
- title: "Convolutional Layers"
contents:
- starts_with("layer_conv_")
... Then |
Or maybe make the special name go inside? reference:
- title: "Layers"
contents:
- subtitle: "Core Layers"
contents:
- layer_input
...
- subtitle: "Convolutional Layers"
contents:
- starts_with("layer_conv_")
... Then |
Another idea would be to enable a user-provided TOC spec for the reference. Would create the TOC by parsing the initial reference index html output, updating In this case we wouldn't have to rewrite reference processing code, users wouldn't have to rewrite their reference index yaml, and the TOC spec might also be useful for articles. reference:
- toc:
section: "Layers"
- title: "Core Layers"
- title: "Convolutional Layers"
... original reference is unchanged ...
- title: "Core Layers"
contents:
- layer_input
...
- title: "Convolutional Layers"
contents:
- starts_with("layer_conv_")
... |
My main concern with that approach is the matching is a bit tricky, and we'd have to think carefully about messaging so people could figure out why things were going wrong. Anyway, I'll have a play around over the next couple of days, and see how it feels with an implementation. |
Yet another idea — we could flatten the yaml: reference:
- title: "Layers"
- subtitle: "Core Layers"
- topics:
- layer_input
- subtitle: "Convolutional Layers"
- topics:
- starts_with("layer_conv_") This would be a bigger change, but I think I'm going to do it internally because it makes the implementation simpler. |
For now, I think we can leave at reference:
- title: "Layers"
- subtitle: "Core Layers"
contents:
- layer_input
- subtitle: "Convolutional Layers"
contents:
- starts_with("layer_conv_") |
For very long reference indexes (like keras). Ideally toc would expand/contract too. Could also imagine having a separate page for each top level section.
The text was updated successfully, but these errors were encountered: