最近,我通过项目的sphinx_autodoc_typehints开始使用狮身人面像的sphinx_autodoc_defaultargs扩展和。看起来,在readthedocs上的sphinx安装中并不是默认的包( sphinx在v1.8.5上)。因为我的构建失败了,Extension error显示了
Could not import extension sphinx_autodoc_typehints (exception: No module named
'sphinx_autodoc_typehints')
我知道我必须告诉readthedocs从sphinx_au
我希望使用为我的项目生成文档(包括用autodoc自动生成文档)。但是,我的项目使用Python3.5语法(async和await),看起来它无法处理这个问题。构建成功了,尽管我遇到了很多这样的错误:
/home/docs/checkouts/readthedocs.org/user_builds/sparrow/checkouts/latest/docs/source/entity.rst:176: WARNING: autodoc: failed to import module 'sparrow.entity'; the following exception was r
我使用读取我的Python代码中的函数注释,并使用它生成适当的预期参数类型和返回类型。它在我的本地机器上运行得很好,但我当然不得不使用pip install sphinx-autodoc-annotation。
我试图使用生成相同的文档,但是它给了我一个错误:
Could not import extension sphinx_autodoc_annotation (exception: No module named sphinx_autodoc_annotation)
是否可以将Read Docs配置为使用sphinx-autodoc注释,如果可以,我如何使其工作?
我已经为Python3.6项目设置并构建了狮身人面像文档(2.1.2),该项目目前位于私有GitHub存储库中。在公开发布项目之后,我想在readthedocs.org上托管这些文档,但是目前readthedocs构建总是失败的。
git clone --no-single-branch --depth 50 https://github.com/<user name>/<repo name> .
Cloning into '.'...
fatal: could not read Username for 'https://github.co
我正在尝试用C代码生成一些由SWIG生成的python接口模块的文档。我在SWIG接口文件(*.i)中使用了%feature(docstring)指令,就像帖子中提到的:
SWIG正在按照预期在生成的python模块中生成文档字符串。
但是当我试图从SWIG生成的python模块中生成文档时,它抛出了异常:
/home/imitra/testdoc/doc/test_module.rst:4: WARNING: autodoc: failed to import module u'test_module'; the following exception was raised:
我维护着一个Python包,它通常以import numpy as np或import pandas as pd的方式导入,带有一个简短的标准化昵称。假设它是import foobar as fb。
我正在使用sphinx来记录它,在我的conf.py中,我的extensions中有'sphinx.ext.autodoc',还有default_role = 'py:obj'。这是一个很好的设置,因为这意味着只要我的文档字符串或单独的.rst文件包含一个整洁的字符串,比如
See the `foobar.Thing` class documentation for
我有带有NumPy文档字符串的Python代码。设法将Sphinx用于应用程序接口文档,但是,__init__.py文件中的类没有成功记录。
示例:xxx/__init__.py
from __future__ import annotations
import sys
import re
from typing import Iterator, ...
import pyparsing as p
__all__ = ['Xxx']
class XxxData:
"""It is a class XxxData."""
我正在尝试获取一个下载链接,以便在使用reStructuredText (reST)和Sphinx阅读文档时使用。在的reST文档中,提供下载链接的示例如下所示
.. only:: builder_html
See :download:`this example script <../example.py>`.
在本地制作html源文件时,链接会出现,但在Read the Docs上使用GitHub链接项目时,链接不会出现。
我正在尝试将我的狮身人面像文档与ReadtheDocs链接起来。我可以在本地构建文档,但是当我尝试让ReadtheDocs自动生成文档时,我会得到以下错误:
狮身人面像标准误差
Making output directory...
Exception occurred:
File "/var/build/user_builds/mousedb/checkouts/latest/Docs/source/conf.py", line 25, in <module>
from mousedb import settings
ImportError: No m
使用Sphinx 2.2.0和python 3.6.8 我有两个类,A和B,A的一个属性生成一个实例B。我希望我的sphinx html输出引用对象B,但我希望原始文档字符串不具有任何sphinx/rest格式。我正在使用autodoc,A中的大多数方法和属性都不需要这种修改,但如果可能的话,我想在几个地方这样做。 class A(object):
"""
This is class A.
"""
@property
def getB(self):
"""
当在读文档中运行autodoc时,它在我的项目中出现以下错误时失败:
Compiling sources ...error: [Errno 2] No such file or directory: 'gfortran'
我已经了解到RTDF中没有gfortran,所以我想尝试避免在运行Sphinx时导致错误的命令,比如
if not 'sphinx' in sys.modules
正如中所建议的。
但是,当我想在RTFD上构建文档时,仍然会发生错误。我甚至对包含命令的整行进行了评论,但都没有成功。显然,RTFD不使用存储库分支中应该构建的当前代码,因为它仍然从
我正在尝试从我的模块中提取文档字符串并构建一个很好的文档。所以我和狮身人面像在一起,我不知道出了什么问题。
我的类docstring,在_meta文件中:
class MasterBlock(object):
"""
Main class for block architecture. All blocks should inherit this class.
Methods
-------
main()
Override it to define the main function of this bl