带有狮身人面像的Robotframework文档
我在为狮身人面像的Robotframework资源创建自动文档时有很小的问题。
我找到了两个插件:
sphinxcontrib_robotdoc
,sphinxcontrib_robotframework
。
但是sphinxcontrib_robotdoc
是一个非常古老的解决方案,看起来像s ** t。因此,我想检查第二个解决方案,但它不起作用。
conf.py:
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
# -- Project information -----------------------------------------------------
project = 'example RF documentation'
author = 'CG'
release = '0.0.1'
# -- General configuration ---------------------------------------------------
extensions = ['sphinx.ext.autodoc',
'm2r2',
'autodocsumm',
'sphinxcontrib_robotframework'
]
autodoc_default_flags = ['members', 'undoc-members', 'inherited-members']
autodoc_default_options = {
'autosummary': True,
}
source_suffix = ['.rst', '.md']
templates_path = ['_templates']
exclude_patterns = []
sphinxcontrib_robotframework_enabled = True
sphinxcontrib_robotframework_quiet = True
sphinxcontrib_robotframework_variables = {
"VARIABLE": "value"
}
# -- Options for HTML output -------------------------------------------------
html_theme = 'sphinx_rtd_theme'
master_doc = 'index'
index.rst:
example RF documentation
============================
.. toctree::
:caption: Table of content
:maxdepth: 3
:glob:
interfaces/*
changelog/*
example/*
interface.rst:
example RF documentation
============================
Keywords
********
.. automodule:: example_rf_docu
:members:
:inherited-members:
:undoc-members:
.. code:: robotframework
creating documentation command:
sphinx-build -b html /home/ute/repo/example_rf_docu/docs/source/ /home/ute/repo/example_rf_docu/doc_files/
command output:
Running Sphinx v4.1.2
WARNING: while setting up extension sphinxcontrib_robotframework: directive 'code' is already registered, it will be overridden
loading pickled environment... done
[autosummary] generating autosummary for: changelog/changelog.rst, example/example.rst, index.rst, interfaces/interface.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.
build succeeded, 1 warning.
The HTML pages are in doc_files.
In output we can see [autosummary]生成自室的for:changeLog/changelog.rst,示例/示例.rst,index.rst,Interfaces/Interfaces/interface.rst
,列表中的每个页面都是正确生成的:
- index:index:外观:外观:外观好(一切看起来都像我计划),
- ChangElog:看起来不错(基于整个项目的Changelog生成页面),
- 例如:看起来不错(它是空的,因为我还没有添加任何示例)
- 接口:看起来错了,因为仅包含有关成员,继承的会员和Undoc-Members的信息主项目目录),并且不包含来自项目的任何RobotFramework文件的RobotFramework关键字的信息。那是我的小问题。
任何想法我能改善这一点并使其起作用。
I have small issue with creating automatic documentation for RobotFramework resources in Sphinx.
I've found two plugins:
sphinxcontrib_robotdoc
,sphinxcontrib_robotframework
.
But sphinxcontrib_robotdoc
is a very old solution and looks like s**t. So I want to check the second solution but it doesn't work.
conf.py:
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
# -- Project information -----------------------------------------------------
project = 'example RF documentation'
author = 'CG'
release = '0.0.1'
# -- General configuration ---------------------------------------------------
extensions = ['sphinx.ext.autodoc',
'm2r2',
'autodocsumm',
'sphinxcontrib_robotframework'
]
autodoc_default_flags = ['members', 'undoc-members', 'inherited-members']
autodoc_default_options = {
'autosummary': True,
}
source_suffix = ['.rst', '.md']
templates_path = ['_templates']
exclude_patterns = []
sphinxcontrib_robotframework_enabled = True
sphinxcontrib_robotframework_quiet = True
sphinxcontrib_robotframework_variables = {
"VARIABLE": "value"
}
# -- Options for HTML output -------------------------------------------------
html_theme = 'sphinx_rtd_theme'
master_doc = 'index'
index.rst:
example RF documentation
============================
.. toctree::
:caption: Table of content
:maxdepth: 3
:glob:
interfaces/*
changelog/*
example/*
interface.rst:
example RF documentation
============================
Keywords
********
.. automodule:: example_rf_docu
:members:
:inherited-members:
:undoc-members:
.. code:: robotframework
creating documentation command:
sphinx-build -b html /home/ute/repo/example_rf_docu/docs/source/ /home/ute/repo/example_rf_docu/doc_files/
command output:
Running Sphinx v4.1.2
WARNING: while setting up extension sphinxcontrib_robotframework: directive 'code' is already registered, it will be overridden
loading pickled environment... done
[autosummary] generating autosummary for: changelog/changelog.rst, example/example.rst, index.rst, interfaces/interface.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.
build succeeded, 1 warning.
The HTML pages are in doc_files.
In output we can see[autosummary] generating autosummary for: changelog/changelog.rst, example/example.rst, index.rst, interfaces/interface.rst
and it's true every page from the list is generated properly:
- index: looks good (everything looks like I've planned),
- changelog: looks good (generate page based on changelog of whole project),
- example: looks good (it's empty because I haven't added any examples)
- interfaces: looks wrong, because contains only information about members, inherited-members and undoc-members like i set in
interface.rst
for whole project (init.py in main project directory) and contains no information about RobotFramework keywords from any RobotFramework file from project. And that's my small issue.
Any ideas what can I improve this and make it work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论