Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Always use / in toctree (also on Windows)? #161

Closed
tobiasleibner opened this issue Aug 7, 2024 · 1 comment · Fixed by #162
Closed

Always use / in toctree (also on Windows)? #161

tobiasleibner opened this issue Aug 7, 2024 · 1 comment · Fixed by #162
Labels
bug Something isn't working

Comments

@tobiasleibner
Copy link

tobiasleibner commented Aug 7, 2024

CMinx uses toctree.text(os.path.join(directory, "index.rst")) (here) to insert the the index files in the toctree. On Windows, this results in, e.g.,

#####
Title
#####

.. toctree:: 
   :maxdepth: 2

   subfolder\index.rst
   cmakefile1
   cmakefile2

with a backslash as path separator. When reading this file, Sphinx gives the following warning:

sphinx.errors.SphinxWarning: C:\...\build\win_msvc\docs\Debug\sphinx_src\cmake\index.rst:6:toctree contains reference to nonexisting document 'folder/subfolder\\index'

Replacing the backward by a forward slash, i.e., subfolder/index.rst instead of subfolder\index.rst fixes the problem.

I could not find a definite reference for that but it looks like the paths in the toctree should always use a forward slash?

@tobiasleibner tobiasleibner added the bug Something isn't working label Aug 7, 2024
@ryanmrichard
Copy link
Collaborator

I just did a couple searches myself. While I also can't find an authoritative source there seems to be enough issues about needing "/" on Windows to suggest that using os.path.join is wrong. I should have some free time in the next couple hours to try to fix this.

ryanmrichard added a commit that referenced this issue Aug 7, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants