Visual Studio C++ 文档生成器

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

Visual studio c++ documentation generator

c++visual-studiovisual-c++documentation

提问by hara

Is there a way to get documentation(like javadoc) in a visual-c++ project?

有没有办法在 Visual-C++ 项目中获取文档(如 javadoc)?

I'm using visual studio 2010.

我正在使用 Visual Studio 2010。

thanks!

谢谢!

采纳答案by Simon

You could use the XML-Documentationformat, supported by VS2010, too. http://msdn.microsoft.com/en-us/library/ms177226%28VS.80%29.aspx

您也可以使用VS2010 支持的XML 文档格式。http://msdn.microsoft.com/en-us/library/ms177226%28VS.80%29.aspx

After commenting your code, you can use Sandcastleto create a MSDN-like documentation: http://sandcastle.codeplex.com/. (Here is a GUI representation for Sandcastle, which is a lot easier to use: https://github.com/EWSoftware/SHFB)

注释您的代码后,您可以使用Sandcastle创建类似 MSDN 的文档:http: //sandcastle.codeplex.com/。(这是 Sandcastle 的 GUI 表示,它更容易使用:https: //github.com/EWSoftware/SHFB

I use AtomineerUtilsto create the XML-Documentation headers automatically. This tool will help you a lot. You can have free base version here: http://www.atomineerutils.com/products.php

我使用AtomineerUtils自动创建 XML-Documentation 标头。这个工具会帮到你很多。你可以在这里有免费的基础版本:http: //www.atomineerutils.com/products.php

回答by KTC

You can have a look at Doxygen.

你可以看看Doxygen

回答by Jason Williams

You could use my addin, Atomineer Pro Documentationto quickly generate documentation comments in Documentation-XML, Doxygen, Qt or JavaDoc format. Then use Sandcastle (DocXml) or Doxygen (DocXml, Doxygen, Qt, Javadoc) to convert this documentation into external documentation files.

您可以使用我的插件Atomineer Pro Documentation来快速生成 Documentation-XML、Doxygen、Qt 或 JavaDoc 格式的文档注释。然后使用 Sandcastle (DocXml) 或 Doxygen (DocXml, Doxygen, Qt, Javadoc) 将这个文档转换成外部文档文件。

I'd recommend uing DocXml format because all the above tools work with it, and Visual Studio recognises it (it syntax colours it, and it builds the docs into its intellisense database so it appears in tool-tip help as you type class/method names into your code).

我建议使用 DocXml 格式,因为上述所有工具都可以使用它,并且 Visual Studio 可以识别它(它对它进行语法着色,并将文档构建到其智能感知数据库中,因此在您键入 class/method 时它会出现在工具提示帮助中将名称添加到您的代码中)。

回答by DWORD

Also, take a look at CppTripleSlash - xml doc comments for c++. It is a free Visual Studio 2015, 2013, 2012, 2010 extension.

另外,请查看CppTripleSlash - c++ 的 xml doc 注释。它是一个免费的 Visual Studio 2015、2013、2012、2010 扩展。

回答by Xavier Ho

One way to generate documentation is - you guessed it - javadoc. You simply have to comment the same way you usually do, and javadoc does a good job of converting them to HTML/LaTeX style.

生成文档的一种方法是 - 您猜对了 - javadoc。您只需按照通常的方式进行评论,javadoc 可以很好地将它们转换为 HTML/LaTeX 样式。

Of course, that's not the only solution. I'll leave room for others.

当然,这不是唯一的解决方案。我会为其他人留出空间。

回答by Xavier Ho

If you are using Visual Studio 2015 then there is a Doxygen generator written for the Macro explorer extension which uses JavaScript for it's macro language.

如果您使用的是 Visual Studio 2015,那么有一个为宏资源管理器扩展编写的 Doxygen 生成器,它使用 JavaScript 作为其宏语言。

Project is on github here: https://github.com/cppocl/visual_studio_macros

项目在 github 上:https: //github.com/cppocl/visual_studio_macros

回答by sailfish009

If you don't mind, some hand written documentation, then sphinx is the perfect tool.

如果您不介意一些手写文档,那么 sphinx 是完美的工具。

http://www.sphinx-doc.org/en/stable/

http://www.sphinx-doc.org/en/stable/

and here is example:

这是示例:

http://ceres-solver.org/

http://ceres-solver.org/

sphinx-build -b singlehtml doc/ build/