Sphinx 是否已经适用于 C++ 文档?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12933900/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is Sphinx already suitable for C++ documentation?
提问by clstaudt
I want to try out documentation generators for a new project in C++. I think my options are either Doxygen or Sphinx. Since I have projects in Python for which I'd like to use Sphinx, I wonder whether Sphinx is the right choice for C++ as well. The Sphinxwebsite states that C++ is supported, but I could not find a document to get me started with C++ documentation.
我想在 C++ 中为一个新项目尝试文档生成器。我认为我的选择是 Doxygen 或 Sphinx。由于我有 Python 项目,我想使用 Sphinx,我想知道 Sphinx 是否也是 C++ 的正确选择。该狮身人面像的网站指出,支持C ++,但我无法找到一个文件让我开始用C ++文档。
A similar question has already been discussed on Stackoverflowand the main answer concludes:
Stackoverflow上已经讨论过类似的问题,主要答案总结如下:
not yet fully usable,
but keep watching
尚未完全可用,
但请继续关注
Since the discussion is well over a year old, I wonder whether this conclusion is still valid. Should I choose Doxygen over Sphinx for my C++ documentation?
由于讨论已经一年多了,我想知道这个结论是否仍然有效。我应该为我的 C++ 文档选择 Doxygen 而不是 Sphinx?
采纳答案by lunaryorn
回答by Synxis
For C++ Doxygen is very good; Sphinx support of C++ is done via Doxygen (using Breathe).
对于 C++ Doxygen 非常好;Sphinx 对 C++ 的支持是通过 Doxygen 完成的(使用Breathe)。
You want to have only one tool for the two languages, to improve maintainability. Doxygen can generate a documentation from Python code, so I advise you to use Doxygen for both sources, if possible. Here is a tutorial for Doxygen and Python.
您希望只有一种工具可以用于两种语言,以提高可维护性。Doxygen 可以从 Python 代码生成文档,因此我建议您尽可能将 Doxygen 用于这两个来源。这是 Doxygen 和 Python 的教程。