How to import Markdown with Sphinx and myst-parser into Readthedocs?

1.3k Views Asked by At

In my docs/source/conf.py I have this code:

extensions = [
    "sphinx.ext.autodoc",
    "myst_parser",
]
source_suffix = ['.rst', '.md']

All my files are in Markdown, not in reStructuredText.

On ReadTheDocs, the initial build was successful technically, only until the modules page was "not found" and the index page is completely blank.

My .readthedocs.yaml:

# .readthedocs.yaml
# 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/source/conf.py

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

# Optionally set the version of Python and requirements required to build your docs
python:
  version: "3.8"
  install:
    - method: pip
      path: .
      extra_requirements:
        - docs

My setup.cfg contains this:

[options.extras_require]
docs =
    sphinx
    myst-parser

Of course, doing make clean html in docs/ works completely fine. Not sure why ReadTheDocs cannot properly link to the rest of the.md files from index.md.

1

There are 1 best solutions below

0
On

I solved it. I checked the build logs, turns out I have some syntax errors (I did list[str] not List[str] with from typing import List)