readthedocs / readthedocs.org

The source code that powers readthedocs.org
https://readthedocs.org/
MIT License
8.05k stars 3.59k forks source link

Getting 404 on Module Index page #4465

Closed mertyildiran closed 6 years ago

mertyildiran commented 6 years ago

Details

Expected Result

On my local machine, I'm building the documentation with:

sphinx-quickstart
sphinx-apidoc -f -o source/ ../dragonfire/
make html

and Module Index page is working perfectly fine:

Actual Result

But when I build the documentation on Read the Docs side, I get 404 on Module Index page: https://dragonfire.readthedocs.io/en/latest/py-modindex.html

I tried to remove non-ASCII characters with: https://github.com/DragonComputer/Dragonfire/commit/e45a11e7402e8fa53a6311d012ea6db04f537458 https://github.com/DragonComputer/Dragonfire/commit/b1818c4c04a31d57601f216060291893f8055cb2 and removed Markdown support with: https://github.com/DragonComputer/Dragonfire/commit/2a31dc1a8215e0f4a18d795438be5cb4d6c26431

but none of them solved the issue.

stsewd commented 6 years ago

Sorry but I don't see the file in your repo https://github.com/DragonComputer/Dragonfire/tree/master/docs/source

mertyildiran commented 6 years ago

make html generates it by looking up for docstrings in the whole project: I did what you said in here but did not change anything.

stsewd commented 6 years ago

RTD execute the sphinx-build command only, it doesn't execute the make file nor the sphinx-apidodc command. See https://github.com/rtfd/readthedocs.org/issues/1139

mertyildiran commented 6 years ago

@stsewd I removed the build directory with rm -rf build/ and ran:

sphinx-build -b html source/ build/

It gave me exactly the same result with make html. I don't understand your point?

stsewd commented 6 years ago

You executed this command sphinx-apidoc -f -o source/ ../dragonfire/, which places the output inside the source/ dir

mertyildiran commented 6 years ago

@stsewd sphinx-apidoc -f -o source/ ../dragonfire/ generates the .rst files according to my module structure right? So what's the relevance of sphinx-apidoc to generating .html documents from those .rst files?

stsewd commented 6 years ago

The modindex or py-modindex is still missing there, not sure how apidoc works here, can you check if this happens in a new virtualenv executing the same steps that rtd does?

mertyildiran commented 6 years ago

@stsewd please look at this repository for example: https://github.com/goldsmith/Wikipedia/tree/master/docs/source

It does not have any modindex.rst file, py-modindex.rst file or anything like that but it has http://wikipedia.readthedocs.io/en/latest/py-modindex.html available in its documentation.

mertyildiran commented 6 years ago

@stsewd I realized that the build was actually failing due to some missing dependencies and/or post-install scripts(when I noticed the "View raw" link on Read the Docs):

WARNING: autodoc: failed to import module 'dragonfire.api'; the following exception was raised:
No module named 'nltk'
WARNING: autodoc: failed to import module 'dragonfire.arithmetic'; the following exception was raised:
No module named 'nltk'
WARNING: autodoc: failed to import module 'dragonfire.config'; the following exception was raised:
No module named 'nltk'
...

So after dealing some problems like excessive memory consumption, mocking out Python C extension, including Markdown into reStructuredText, etc. and after 23 commits/builds I finally achieved what I want:

https://github.com/DragonComputer/Dragonfire/commit/67068f13eb98b1a267ff89faec081b0d153cef92

https://dragonfire.readthedocs.io/en/latest/py-modindex.html (Working :+1: )

Thanks for the help! :trophy:

g1itch commented 5 years ago

https://dragonfire.readthedocs.io/en/latest/py-modindex.html (Working +1 )

Not working. It's still showing the maze.