Try Sandcastle and the Sandcastle Helpfile Builder. It creates CHMs and MSHelpfiles or HTML Pages in MSDN Style. Its simple to use and it can load Soultion Files.
Helpfile Builder with Sandcaste: http://shfb.codeplex.com/
Sandcastle only: http://sandcastle.codeplex.com/
First it is worth saying that it is commendable that you want to document the API of your libraries so that others (or even you at a future date:-) will be able to use your code without having to read your code. That is a great step in itself!
There are a variety of tools that help automate this task, notably Doxygen and Sandcastle, as others have previously mentioned. I have not used Doxygen so I will restrict my comments to Sandcastle. Sandcastle, provided by Microsoft, is a great starting point but apparently is quite difficult to use, hence a number of motivated independent developers built more usable interfaces on top of Sandcastle. The premier one of these is Sandcastle Help File Builder (SHFB). With the GUI of SHFB you "simply" create a Sandcastle project, set the project properties to your liking, then build your documentation set as a web site or a CHM file or a couple other formats.
I wrote simply in quotes above because working in SHFB is the smallest part of the task in front of you--the much more vast task is decorating your code with appropriate and correct documentation comments (doc-comments) that serve as the "source code" for Sandcastle or other documentation engine. It takes a substantial investment of your time and energy to document all your code but I believe, as you may have inferred, that it is definitely worth it. Besides the aforementioned reason that others will be able to use your code much more easily, I find that documenting my code has one other important benefit--it helps me write better code. As I start documenting a new method or class I often remark to myself "Oh, this parameter would be more clear if it was called Y rather than X." or "Oops--this method is not generic enough for others; I need to add a Z parameter." or "Hah! This class does not handle these corner cases quite right." In other words, the act of describing your class or method or parameter makes you think carefully about it and thus writing doc-comments leads to better code.
So much for theory; for some practical advice and guideline for Sandcastle and SHFB, take a look at my article on Simple-Talk.com entitled Taming Sandcastle: A .NET Programmer's Guide to Documenting Your Code. This article thoroughly documents all the things I found through research and experimentation with SHFB. Accompanying the article is a handy wallchart that brings together all the documented and the undocumented elements and attributes that you may use in doc-comments. Here's a fragment of the wallchart to whet your appetite:
发布评论
评论(4)
尝试 Sandcastle 和 Sandcastle 帮助文件生成器。它以 MSDN 风格创建 CHM 和 MSHelpfiles 或 HTML 页面。它使用简单,可以加载 Soultion 文件。
使用 Sandcaste 的帮助文件生成器:http://shfb.codeplex.com/
仅限 Sandcastle:http://sandcastle.codeplex.com/
Try Sandcastle and the Sandcastle Helpfile Builder. It creates CHMs and MSHelpfiles or HTML Pages in MSDN Style. Its simple to use and it can load Soultion Files.
Helpfile Builder with Sandcaste: http://shfb.codeplex.com/
Sandcastle only: http://sandcastle.codeplex.com/
您可以使用以下命令创建类似 MSDN 的文档
沙堡
You can create MSDN like documentation with
Sandcastle
Doxygen 将从代码中的注释生成漂亮的 HTML 文档,前提是您遵循一些简单的格式规则。
Doxygen will generate nice HTML documentation from the comments in your code, provided that you follow a few simple formatting rules.
首先值得一提的是,您希望记录您的库的 API,以便其他人(甚至您在未来的日期:-)能够使用 您的代码,而无需阅读您的代码。这本身就是伟大的一步!
正如其他人之前提到的,有多种工具可以帮助自动执行此任务,特别是 Doxygen 和 Sandcastle。我没有使用过 Doxygen,所以我将把我的评论限制在 Sandcastle 上。 Microsoft 提供的 Sandcastle 是一个很好的起点,但显然很难使用,因此许多积极的独立开发人员在 Sandcastle 之上构建了更多可用的界面。其中第一个是Sandcastle Help File Builder (SHFB)。使用 SHFB 的 GUI,您“简单地”创建一个 Sandcastle 项目,根据您的喜好设置项目属性,然后将您的文档集构建为网站或 CHM 文件或其他几种格式。
我在上面的引号中写了简单,因为在 SHFB 中工作是您面前任务的最小部分 - 更艰巨的任务是用适当且正确的文档注释(文档注释)来装饰您的代码用作 Sandcastle 或其他文档引擎的“源代码”。记录所有代码需要投入大量的时间和精力,但我相信,正如您可能已经推断的那样,这绝对是值得的。除了上述其他人能够更轻松地使用您的代码的原因之外,我发现记录我的代码还有另一个重要的好处——它可以帮助我编写更好的代码。当我开始记录新方法或类时,我经常对自己说“哦,如果将其称为 Y 而不是 X,这个参数会更清晰。” 或 “哎呀——这个方法对于其他人来说不够通用;我需要添加一个 Z 参数。” 或 “这个类不能正确处理这些极端情况。” 换句话说,描述你的类、方法或参数会让你仔细思考它,因此编写文档注释可以生成更好的代码。
理论就讲这么多;有关 Sandcastle 和 SHFB 的一些实用建议和指南,请参阅我在 Simple-Talk.com 上题为 驯服 Sandcastle:.NET 程序员编写代码文档的指南。这篇文章彻底记录了我通过 SHFB 研究和实验发现的所有内容。本文附带有一个方便的 挂图汇集了您可能在文档注释中使用的所有已记录和未记录的元素和属性。这是挂图的一部分,可以激发您的兴趣:
First it is worth saying that it is commendable that you want to document the API of your libraries so that others (or even you at a future date:-) will be able to use your code without having to read your code. That is a great step in itself!
There are a variety of tools that help automate this task, notably Doxygen and Sandcastle, as others have previously mentioned. I have not used Doxygen so I will restrict my comments to Sandcastle. Sandcastle, provided by Microsoft, is a great starting point but apparently is quite difficult to use, hence a number of motivated independent developers built more usable interfaces on top of Sandcastle. The premier one of these is Sandcastle Help File Builder (SHFB). With the GUI of SHFB you "simply" create a Sandcastle project, set the project properties to your liking, then build your documentation set as a web site or a CHM file or a couple other formats.
I wrote simply in quotes above because working in SHFB is the smallest part of the task in front of you--the much more vast task is decorating your code with appropriate and correct documentation comments (doc-comments) that serve as the "source code" for Sandcastle or other documentation engine. It takes a substantial investment of your time and energy to document all your code but I believe, as you may have inferred, that it is definitely worth it. Besides the aforementioned reason that others will be able to use your code much more easily, I find that documenting my code has one other important benefit--it helps me write better code. As I start documenting a new method or class I often remark to myself "Oh, this parameter would be more clear if it was called Y rather than X." or "Oops--this method is not generic enough for others; I need to add a Z parameter." or "Hah! This class does not handle these corner cases quite right." In other words, the act of describing your class or method or parameter makes you think carefully about it and thus writing doc-comments leads to better code.
So much for theory; for some practical advice and guideline for Sandcastle and SHFB, take a look at my article on Simple-Talk.com entitled Taming Sandcastle: A .NET Programmer's Guide to Documenting Your Code. This article thoroughly documents all the things I found through research and experimentation with SHFB. Accompanying the article is a handy wallchart that brings together all the documented and the undocumented elements and attributes that you may use in doc-comments. Here's a fragment of the wallchart to whet your appetite: