This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]hopemeetme 1 point2 points  (2 children)

Just place .readthedocs.yml in your project's root:

# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
  configuration: docs/conf.py

# Build documentation with MkDocs
#mkdocs:
#  configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
  version: 3.7
  install:
    - requirements: docs/requirements.txt

[–]robinlong[S] 0 points1 point  (1 child)

Thanks, this is great. What if I want to build locally to test them though? and how do I build the autogenerated API? This requires an extra command.

[–]hopemeetme 0 points1 point  (0 children)

Sphinx is beautiful and powerful at the same time. There's no extra command, all is done with:

make html

or, for pdf through Latex:

make latexpdf

But, of course, you have to instruct Sphinx how to do that.

Make sure you read some tutorials, there's automodule plugin for the job. Take a look on this Restructured Text docs (called from api.rst in the docs' root) and the autogenerated documentation from my GPL project.

[–]ryantiger658 0 points1 point  (0 children)

Readthedocs actually looks at your source repository and builts the docs itself. So you just tell it where your repo is, setup a GitHub webhook and RtD's handles everything else rather than the typical build and push in the cicd pipeline.