在matlab域中使用sphinx自求和扩展
我试图使用带有自动摘要扩展的生成工具箱中几个MATLAB函数的文档。这些函数的文档中的ReST文件如下所示:在matlab域中使用sphinx自求和扩展,matlab,python-sphinx,Matlab,Python Sphinx,我试图使用带有自动摘要扩展的生成工具箱中几个MATLAB函数的文档。这些函数的文档中的ReST文件如下所示: .. currentmodule:: mytoolbox .. autosummary:: :toctree: generated/ :nosignatures: func1 虽然我已将matlab\u src\u dir设置为包含工具箱子目录的正确基本目录,并将autosummary\u generate设置为True,但autosummary扩展会发出警
.. currentmodule:: mytoolbox
.. autosummary::
:toctree: generated/
:nosignatures:
func1
虽然我已将matlab\u src\u dir
设置为包含工具箱子目录的正确基本目录,并将autosummary\u generate
设置为True,但autosummary扩展会发出警告,指示它“导入'mytoolbox.func1'失败:没有名为mytoolbox.func1的模块”。自动摘要扩展是否适用于MATLAB域?如果是这样,我可能会误解什么?我的conf.py
文件包含以下内容:
import sys, os
extensions = ['sphinxcontrib.matlab',
'sphinx.ext.pngmath',
'sphinx.ext.viewcode',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary']
needs_sphinx = '1.0'
templates_path = ['_templates']
autosummary_generate = True
source_suffix = '.rst'
master_doc = 'index'
language = 'en'
exclude_patterns = ['build']
pygments_style = 'sphinx'
matlab_src_dir = os.path.abspath('../../')
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
html_theme = 'default'
else:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_domain_indices = False
html_use_index = True
您的文件结构是什么样的?指向
matlab_src_dir
上方文件夹mytoolbox
也要确保func1.m
存在。我相信我正在这样做-对于基本目录basedir
,matlab文件(func1.m
)位于basedir/mytoolbox
中;Sphinx ReST文件和conf.py
文件存储在basedir/docs/source
中,我验证了basedir/mytoolbox/func1.m
是否存在。我还应该提到我正在使用Sphinx 1.2.3和sphinxcontrib matlabdomain 0.2.6与Python 2.7.6一起使用。@lebedov您尝试过设置默认域吗?我认为它可能默认为.py
…设置主域='mat'
似乎对自动摘要生成没有任何影响。