-
Notifications
You must be signed in to change notification settings - Fork 482
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
Add an option to hide pages in sidebar #282
Conversation
No worries, glad to see you've still got some spare time to work on it!
I'm partial to keeping the hidden pages in the prev/next links. I quite like how the "flow" is still retained through the docs, instead of skipping whole chunks of it — we don't want hidden pages to be truely hidden, just not cluttering up the nav menu (at least that's been my interpretation of the issue so far).
Would definitely get too long at times, I think just listing it at the top would be sufficient.
Agreed, maybe we could have the navigation text (breadcrumbs, next/prev, and current nav link) in italics instead to make it more obvious that the page is different. Syntax-wise I'd be inclined to have this work per-page rather than per-section to make it more "composable", ie. # ...
"Section One" => [
"page.md",
"Hidden" => hide("next-page.md"),
"Another Page" => "other-page.md",
] and just # ...
"Secret Section" => map(hide, [
"One" => "one.md",
"two.md",
] Would it be possible to implement it this way? |
With that definition of hide(page::AbstractString, others::Vector) = vcat(page, map(hide, others)) presumably. |
This looks great @mortenpi! Thanks for starting to work on this. A couple things
I'm fine with either solution. I don't really use the
I think the map solution would work well.
I would prefer if the hidden page shows up in the sidebar. I think it is confusing that arguments and and examples show up under Geometries instead of under Guide.ylabel here: http://mortenpi.eu/Gadfly.jl/lib/guides/guide_ylabel.html#Guide.ylabel-1, for example. Regardless, huge improvement 🎉 |
Another option instead of the |
What about the unix convention of hidden files? |
Was also thinking of that one, but would be a bit annoying perhaps to have them actually hidden when using |
👍
Could be, though I'd say it's just up the authors to do what fits with there docs. I can't, at the moment, think of a particular use case, but it just seems a bit off to restrict it to sections only.
👍
Fine by me. Having a couple of convenience defs for common cases seems like a good idea to me.
That's fine by me then. (Since nav structure also isn't dictated by folder structure either.) |
Also just wanted to add that having Gadfly's docs available to test things out on is great, thanks @tlnagy! |
It wouldn't be a convenience def though, unless I am missing something, since you can't do
without it right now (i.e. to have "A" point to a page). I was briefly thinking that maybe we should allow that somehow, even for cases where we don't hide the pages.
and
crossed my mind, but I am not a particular fan of either.
Yup, this came up before. I think that my general feeling about it is that, in principle, using the file system would be great, but we should go all in then. Since it seems that we need things that we cannot (conveniently) infer from the file system, and hence need to have the |
Perhaps not then. Hadn't actually tried to see whether it would work.
Agreed.
👍 |
Thanks to you all too for accommodating my weird requests :p
Looks great!
👍 |
Any progress on this? This would be nice! |
I literally started working on it again four minutes ago 😆 |
I read your mind haha 😂 |
Switched to |
Ready for another set of eyes I think. Example build with Gadfly docs ( |
All looks good to me, thanks! The hidden pages in the Gadfly docs definitely make the site look much smaller than it actually is, but I think that's probably fine. Let's let @tlnagy have a look over as well though if he's got some time. (This is probably a big enough change to warrant a new |
That looks great! 👍
I think it makes the site a lot less overwhelming, which is good. Also, @mortenpi if you want to submit a PR to Gadfly eventually with these changes, I would be happy to merge them |
In case something goes wrong with LaTeX compilation, it stops and asks for user input. That is not ideal for automated builds and tests. Passing -interaction=nonstopmode to the latexmk command should stop it from doing that and just make the command fail in that case.
Throwing an error if the repo slugs do not match means that Travis builds of forks will always fail. This should instead be a warning instead to inform the user. should_deploy already makes sure that the deployment does not happen on forks.
Currently collect_subsections will ignore all the initial level 1 headers (i.e. if there are several without level 2 headers in-between), but it should ignore only the very first one. Style change is necessary so that the border between page title and first in-page heading would not get too thick.
Adds the `hide` function to the public API that can be used in the `pages` option of `makedocs` build a list of pages that will not be shown in the sidebar. Fixes #230.
One final thing: I propose hiding the pages under Library > Internals with this. Demo here: http://mortenpi.eu/Documenter.jl/hide/ |
Yup, fine by me. |
Might as well tag |
Hey @mortenpi, whenever you get a chance could you submit your changes as a PR. It would be great to have the cleaned up docs for Gadfly. |
GiovineItalia/Gadfly.jl#923? 😆 It does seem that the build on the nightly for that commit failed though (due to a buggy nightly, I believe, not due to Documenter), so the docs were not updated. Re-running that job should deploy the new docs I think. |
Ah yes. Whoops. I just saw that the pages were still not hidden. I'll try and force rebuild. thanks! |
Adds the
Hidden
type that can be used in thepages
option ofmakedocs
to hide but still build a list of pages in the sidebar.So, I'd RFC this implementation. Sorry that it took me a while to get to this. Ref #230.
@tlnagy: I also built the Gadfly docs (build here) when using the
Hidden
feature (make.jl
here). Feedback would be greatly appreciated.I went with the
Hidden(page, [hidden_pages])
option in thepages
variable. Regarding how things get displayed:page
will point to the first ofhidden_pages
etc.; example ). What @tlnagy suggested might be better (to have the visible pages ignore the hidden ones in the next/prev).WIP since the tests need work.