visual-studio Visual Studio 是否可以选择为 Javadoc 样式的注释生成 html 文档?

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

Does Visual Studio have an option to generate html documentation for Javadoc-style comments?

visual-studiovisual-studio-2005javadocdocumentation-generation

提问by Brandon

Does Visual Studio have an option to generate html documentation for Javadoc-style comments? If so, what steps are necessary to accomplish this?

Visual Studio 是否可以选择为 Javadoc 样式的注释生成 html 文档?如果是这样,需要采取哪些步骤来实现这一目标?

In BlueJ there is an option to translate Javadoc-style comments into an html file.

在 BlueJ 中,有一个选项可以将 Javadoc 样式的注释转换为 html 文件。

Like the following picture shows for Java using BlueJ I want to do the same with Visual Studio : http://www.time-tripper.com/uipatterns/Patterns/Titled_Sections/javadoc.gif
(source: time-tripper.com)

就像下图显示的 Java 使用 BlueJ 我想用 Visual Studio 做同样的事情:(来源:time-tripper.comhttp://www.time-tripper.com/uipatterns/Patterns/Titled_Sections/javadoc.gif

回答by Jon Skeet

Do you actually mean JavaDoc, in Java? If so, I don't believe so - just use javadoc itself. Visual Studio doesn't really support Java.

在 Java 中,您实际上是指 JavaDoc 吗?如果是这样,我不相信 - 只需使用 javadoc 本身。Visual Studio 并不真正支持 Java。

If you mean C# XML documentation comments, then you can change the project properties to build the XML file, and then use NDoc(discontinued) or Sandcastleto build HTML (or chm etc). It's not as easy as it might be, admittedly.

如果您的意思是 C# XML 文档注释,那么您可以更改项目属性以构建 XML 文件,然后使用NDoc(已停产)或Sandcastle构建 HTML(或 chm 等)。诚然,这并不像想象的那么容易。

EDIT: If you're using C++, you should probably look at Doxygen. There may be Visual Studio plugins, but you may be best off just running Doxygen as part of your build process. If you're using C++/CLI there may be some equivalent of C# XML comments, but I don't know of it.

编辑:如果你使用 C++,你应该看看Doxygen。可能有 Visual Studio 插件,但最好将 Doxygen 作为构建过程的一部分运行。如果您使用的是 C++/CLI,可能会有一些等效的 C# XML 注释,但我不知道。

回答by Jason Williams

You can use a Javadoc-compatible commenting style, either entering the comments by hand, or use my addin, Atomineer Pro Documentationto take most of the work out of it. Then to generate external documentation, use doxygen, which reads javadoc happily.

您可以使用与 Javadoc 兼容的注释样式,手动输入注释,或使用我的插件Atomineer Pro 文档来完成大部分工作。然后生成外部文档,使用doxygen,它愉快地读取 javadoc。

The alternative is (as Jon has said) to use XmlDoc format comments, which can be used by Visual Studio (for intellisense tooltips), Atomineer, Sandcastle and Doxygen. It's a less human-readable format, but gives you significant advantages within the Visual Studio environment, so it's a bit more flexible.

另一种方法是(如 Jon 所说)使用 XmlDoc 格式的注释,Visual Studio(用于智能感知工具提示)、Atomineer、Sandcastle 和 Doxygen 可以使用它。它是一种不太可读的格式,但在 Visual Studio 环境中为您提供了显着的优势,因此它更灵活一些。

Both approaches will work for C#, C++, C (although C# works better on the intellisense side of things)

这两种方法都适用于 C#、C++、C(尽管 C# 在智能感知方面效果更好)