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

@contents does not respect the order of pages passed to makedocs #936

Open
tkf opened this issue Feb 3, 2019 · 3 comments
Open

@contents does not respect the order of pages passed to makedocs #936

tkf opened this issue Feb 3, 2019 · 3 comments

Comments

@tkf
Copy link
Contributor

tkf commented Feb 3, 2019

In https://tkf.github.io/julia-python-snippets/dev/, I noticed that the order of pages specified in make.jl is reflected only to the sidebar:

image

and not to the table of contents:

image

generated by:

```@contents
```

Is it possible to fix @contents to respect the order of pages?

The Travis build is using Documenter v0.21.1. I tried using Documenter master 43cb56a locally but the result was the same.

@martinholters
Copy link

From a brief look, the order of the entries in @contents (unless explicitly specified with a Pages=... therein) seems inherently undefined, as it depends on the iteration order of a Dict.
I think in

# Sorting contents links.
pagesmap = precedence(contents.pages)

one would need to check whether isempty(contents.pages) (i.e. Pages=... is not given) and then extract the files from document.user.pages (the array given to makedocs) instead. I don't have the bandwidth to work that out and turn it into a PR, so leaving this here for anyone willing to pick it up.

@laborg
Copy link
Contributor

laborg commented Oct 14, 2023

I thought I stumbled over this bug but what I actually missed is the initial upper case of Pages in the @contents block. It would really be good to warn on unexpected (pages instead of Pages) settings!

@mortenpi
Copy link
Member

@laborg Do you want to open a separate issue for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants