首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用Sphinx和myst-parser将Markdown导入Readthedocs?

如何使用Sphinx和myst-parser将Markdown导入Readthedocs?
EN

Stack Overflow用户
提问于 2021-09-23 02:21:30
回答 1查看 372关注 0票数 1

在我的docs/source/conf.py中,我有这样的代码:

代码语言:javascript
复制
extensions = [
    "sphinx.ext.autodoc",
    "myst_parser",
]
source_suffix = ['.rst', '.md']

我所有的文件都是Markdown格式的,不是reStructuredText格式的。

在ReadTheDocs上,最初的构建在技术上是成功的,只是在“找不到”模块页面和索引页完全空白之前。

我的.readthedocs.yaml

代码语言:javascript
复制
# .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

我的setup.cfg包含以下内容:

代码语言:javascript
复制
[options.extras_require]
docs =
    sphinx
    myst-parser

当然,在docs/中做make clean html完全没问题。不确定为什么ReadTheDocs无法正确链接到index.md中的其余.md文件。

EN

回答 1

Stack Overflow用户

发布于 2021-09-23 13:15:34

我解决了。我检查了构建日志,发现我有一些语法错误(我没有用from typing import List list[str] List[str] )

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69293277

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档