Search code examples
pythonpython-sphinxread-the-docs

Read the docs only import links and not the contents in it


I am very new to read the docs. I have a documentation folder docs in my github repo created using Sphinx in my local machine. I tried to link the docs to Read the Docs.

From settings of the repo I added the read the docs service.

From Read the Docs website I imported the project.

But, the documentation in read the docs only shows the front page of index.html file. When I click any links all are empty. However, in my local machine all the links are text in it.

My github repo is this: github repo

My ReadTheDocs link is : readthedocs docs

File Structure

  • docs
    • html
    • rst
      ** conf.py
    • source
    • Makefile
  • src

The main page of index.html

The main page of index.html

In my machine when I click first link it has contents

enter image description here

In readthedocs website when I click first link it is EMPTY

enter image description here

Note that the whole repo is same in both github website and my local machine.
All the files in computer are uploaded in github, but still readthedocs only can not find the documentation.

Question: How can we show the contents of links in ReadTheDocs ?

What am I doing wrong?
Is there a way to fix the problem or RTD only shows the front page?

Simple Test:
We can download the repo (5Mb) and run index.html which shows contents inside a0_interpolate_flux link, but if we click the same link in readthedocs given above it does not show any docstring contents.

Update
I have googled a lot and also tried read the docs website, but to no avail. I wonder how the same HTML page opens differently in local machine and readthedocs webhost?

Some related links are following:

[1]: https://stackoverflow.com/questions/41029181/read-the-docs-not-updating-with-new-files?rq=1


Solution

  • You need to tell RTD to install your package. See RTD FAQ My project isn’t building with autodoc.

    If you look at your RTD build history, and expand the third bar, you will see the import errors.

    To fix it:

    1. Configure the RTD Admin to use a virtual environment and install your package, using a requirements.txt file.
    2. Create a requirements.txt file and push it to your repo, specifying your project's requirements, itself included.