类似 Javadoc 的 C++ 文档

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1141228/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 00:13:41  来源:igfitidea点击:

Javadoc-like Documentation for C++

javac++javadoc

提问by DHamrick

Are there similar documentation generation systems like Javadoc, for C++? Javadoc produces nice output; It would be great if you could use something like it in other languages.

对于 C++,是否有类似 Javadoc 的文档生成系统?Javadoc 产生不错的输出;如果你能在其他语言中使用类似的东西,那就太好了。

采纳答案by Zayenz

There are several tools that works like JavaDoc for C++ The most popular tool is probably doxygen. It can handle JavaDoc-like comments, and also several languages (e.g., C++, C, Java, Objective-C, Python, PHP, C#). It has pretty good support for tweaking the style of the HTML output using CSS (see the users listfor example documentations).

有几个工具可以像 C++ 的 JavaDoc 一样工作。最流行的工具可能是doxygen。它可以处理类似 JavaDoc 的注释,也可以处理多种语言(例如,C++、C、Java、Objective-C、Python、PHP、C#)。它对使用 CSS 调整 HTML 输出的样式有很好的支持(请参阅用户列表以获取示例文档)。

Two important issues when choosing the documentation system is to make sure that it allows you to

选择文档系统时的两个重要问题是确保它允许您

  • Document the entities that you are interested in. Do you want to document the system following the code structure or according to some other module division.
  • Getting the output formatted as you want. It is preferable when the documentation fits in with your general project style.
  • 记录您感兴趣的实体。您想按照代码结构还是按照其他一些模块划分来记录系统。
  • 根据需要格式化输出。当文档符合您的一般项目风格时更可取。

Our experience with doxygen is that it is pretty easy to set up and use, and the resulting output is fairly easy to tweak. Unfortunately, doxygen is not perfect, so in some cases it is necessary to work around quirks or bugs where the doxygen parser breaks down. Be sure to inspect all of your generated documentation carefully.

我们使用 doxygen 的经验是它非常容易设置和使用,并且生成的输出也很容易调整。不幸的是,doxygen 并不完美,因此在某些情况下,有必要解决 doxygen 解析器崩溃的怪癖或错误。请务必仔细检查所有生成的文档。

回答by Grant Limberg

There's doxygen that supports a lot of things (and more) Doxygen

Doxygen支持很多东西(以及更多)Doxygen

回答by dreadwail

You can't use javadoc specifically, but there are a couple of tools that do what you want. The one most people tend to use is Doxygen. Here are some links for Doxygen and Doc++:

您不能专门使用 javadoc,但是有一些工具可以满足您的需求。大多数人倾向于使用的一种是 Doxygen。以下是 Doxygen 和 Doc++ 的一些链接:

Doxygen
Doc++

Doxygen
文档++

回答by Yair

There is also qdoc for QT based C++ projects. http://doc-snapshot.qt-project.org/qdoc

还有用于基于 QT 的 C++ 项目的 qdoc。 http://doc-snapshot.qt-project.org/qdoc

回答by Dan H

I'm just starting to use Sphinxfor my Python projects. Its home page states "C/C++ is already supported as well".

我刚刚开始在我的 Python 项目中使用Sphinx。它的主页声明“也已经支持 C/C++”。

It uses a lightweight markup called "reStructuredText".

它使用称为“ reStructuredText”的轻量级标记。

I've just started using it for my Python projects, and like the look of the output very much.

我刚刚开始在我的 Python 项目中使用它,并且非常喜欢输出的外观。