Read the Doc Related
RTD的官方网址:https://readthedocs.org/
在RTD上使用markdown tables
目前,似乎RTD不能自己下载对应的sphinx_markdown_tables这个package,需要手动在目录中添加它以及它的依赖包markdown。
在repository pyradnotes 中,构造文档需要手动上传的package是sphinx_markdown_tables和它的一个依赖package Markdown。
只需要使用pip下载sphinx_markdown_tables这个package即可,它会下载它本身以及需要的依赖包。
pip download sphinx_markdown_tables -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -d "D:\Programs\MyPyPackages\sphinx_markdown_tables_221007"
下载之后,目录中会有四个文件
importlib_metadata-5.0.0-py3-none-any.whl
Markdown-3.4.1-py3-none-any.whl
sphinx_markdown_tables-0.0.17-py3-none-any.whl
zipp-3.8.1-py3-none-any.whl
这里有用的是以下两个
Markdown-3.4.1-py3-none-any.whl
sphinx_markdown_tables-0.0.17-py3-none-any.whl
把它们的后缀修改为.zip,然后分别:
从
Markdown-3.4.1-py3-none-any.zip解压出来markdown目录从
sphinx_markdown_tables-0.0.17-py3-none-any.zip解压出来sphinx_markdown_tables目录
然后把这两个目录放入repo中对应的目录即可。
在repository pyradnotes 中,source/pyextensions 是我用来放置手动上传的package的目录。
放置完成之后,需要在source/conf.py中添加对应的命令,以便python解释器可以找到这个手动上传的包的路径。
if os.environ.get('READTHEDOCS', None) == 'True':
sys.path.insert(0, os.path.abspath(os.path.join('.', 'pyextensions')))
sys.path.insert(0, os.path.abspath('.'))
import sphinx_markdown_tables