jbms / sphinx-immaterial

Adaptation of the popular mkdocs-material material design theme to the sphinx documentation system
https://jbms.github.io/sphinx-immaterial/
Other
196 stars 29 forks source link

Documentation on `version_json` is incorrect #148

Closed brechtm closed 1 year ago

brechtm commented 2 years ago

The docs mention:

When serving the docs from a webserver the version_json file is resolved relative to the parent directory that contains the sphinx builder’s HTML output.

I understood this as that the default (not setting version_json) corresponds to setting it to "versions.json". That doesn't work however. One needs to set it to "../versions.json" instead.

2bndy5 commented 2 years ago

relative to the parent directory that contains the sphinx builder’s HTML output

This description may be too terse or inadequate, but it is correct. The parent of the builder's output is the second non-optional arg passed to the sphinx-build command. Typically this is a sub-folder of the docs' source folder (where conf.py is located) named "_build" (or "_build/html" in which "html" is the parent). Maybe the word "parent" should be changed/removed... How would you word it? (PR is welcome)

brechtm commented 2 years ago

So "parent directory" here refers to the directory that contains index.html? In that case, it is correct indeed. But I read that as "the parent directory of the builder's output directory". Perhaps clearer would be:

When serving the docs from a webserver the version_json file is resolved relative to the directory that contains the sphinx builder’s HTML output.

It would also help if, for the example directory layout given

/versions.json
/1.0/index.html
/2.0/index.html

the sample configuration "version_json": "../versions.json" was given.