【发布时间】:2022-01-14 11:14:57
【问题描述】:
我正在使用Sphinx 准备项目文档,在哪里获取Doxygen XML output 我使用了breathe。我在.rst 文件中使用了呼吸指令。
sample.cpp
namespace X{
class A{
public:
int x;
};
}
在我刚刚添加的rst 文件中
.. doxygenclass:: X::A
:members:
:protected-members:
:private-members:
构建项目后,我可以看到class A 的详细文档。出于某种原因,我打算使用markdown 文件而不是.rst。
我浏览了几篇帖子,但找不到任何富有成效的答案。我得到的最好的一个this StackOverflow answer。
- 我已经安装了myst parser
- 通过添加
extensions = ["myst_parser",]修改conf.py
编写.md文件如下:
# sample_md
```{doxygenclass:: X::A}
:members:
:protected-members:
:private-members:
```
但在错误消息为时失败
WARNING: unknown directive or role name: doxygenclass::A
/net/users/Linux_Home/user_name/project_name/doc/md_files/sample_mark.md:5: WARNING: Unknown directive type "doxygenclass::A".
也试过了
# sample_md
```{doxygenclass}
A
:members:
:protected-members:
:private-members:
```
同样失败和错误信息
Exception occurred:
File "/net/users/Linux_Home/user_name/.local/lib/python3.8/site-packages/myst_parser/docutils_renderer.py", line 973, in run_directive
if issubclass(directive_class, Include):
TypeError: issubclass() arg 1 must be a class
The full traceback has been saved in /tmp/sphinx-err-guubfd6h.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make[2]: *** [doc/CMakeFiles/Sphinx.dir/build.make:63: doc/sphinx/index.html] Error 2
make[1]: *** [CMakeFiles/Makefile2:215: doc/CMakeFiles/Sphinx.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
现阶段不知道该做什么。
我在.md 文件中使用了以下片段
```{cpp:class} X::A
```
它显示了呈现的类,但只有带有可点击链接的名称,其中不存在 Doxygen XML 文档。我需要这些信息。
我的一些纪念活动是:
现在我想知道,是否可以在.md 文件中添加breathe Doxygen directive?如果是,我在哪里使语法错误?
【问题讨论】:
-
当您说“但失败”时,错误是什么?
-
我已经添加了相应的错误信息
标签: c++ markdown python-sphinx doxygen myst