Professional.Open.Source.dot.NET.Development.Programming.with.NAnt.NUnit.NDoc [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Professional.Open.Source.dot.NET.Development.Programming.with.NAnt.NUnit.NDoc [Electronic resources] - نسخه متنی

John Wait

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید







NDoc


NDoc (ndoc.sourceforge.net) is by far the most sophisticated and well-supported documentation tool for C# XML documentation. There is even contributed code to convert between other formats like monodoc and ndoc. NDoc is a little more sophisticated than the other tools in that NDoc does not rely on the C# XML documentation alone but uses reflection to look at the assemblies' metadata tables and extracts all the types. If the types are built into the .NET SDK, NDoc will automatically link to the MSDN documentation. NDoc can even be configured to support multiple .NET runtimes or link to MSDN online documentation. When the types are not found in the .NET SDK, NDoc queries a user-specified XML file. Figure 5-6 shows the easy-to-use NDoc GUI.

Figure 5-6. NDoc Graphical User Interface.

[View full size image]

NDoc integrates well with Visual Studio.NET and can even understand Visual Studio.NET's file structures. Remember that I pointed out that Microsoft also saw the advantage of using XML-based solution and project files. In the NDoc GUI, if you select "New from Visual Studio Solution" from the Project menu item and select a Visual Studio .NET Solution (.sln) file, then NDoc automatically finds all the assemblies in the solution for you.

NDoc Functionality


Like Portable.NET's csDoc, NDoc extends the set of Microsoft-defined tags by defining new <overloads> and <events> tags. This allows for documenting overloaded functions and events raised by a member function. NDoc also extends the grammar of the <see> and <seealso> tags to allow linking to arbitrary URLs (not just other code items). Listing 5.19 shows an example of using embedded HTML to achieve the same linking to a Web site, and Listing 5.20 shows how to use this functionality to link two unrelated MSDN output files together.

Listing 5.19. LogKit.Net>'s Summary


/// <summary>
/// A Simple logging toolkit. Built on <a target="_blank"
href="http://www.pinetree-
tech.com/projects/fog0000000007l">LogKit.Net</a> which was ported
from <a target="_blank"
href="http://jakarta.apache.org/avalon/logkit/indexl">LogKit</a>.
/// </summary>

Some documentation for these extended tags exists in the tagsl file, which is included in the NDoc distribution. NDoc currently runs on Microsoft's .NET CLR and Mono.

NDoc Documentors' Formats


NDoc also has more supported output formats, called documentors, than any other C# XML documentation tool.

MSDN

This output creates a .chm (Compiled HTML) file, which is a nicely packaged help file, as seen in Figure 5-7 on p. 146. This task creates all the HTML files as well, so these files could be posted to a Web page. The MSDN documenter even automatically creates the C# and VB.NET signature for the publicly available methods and properties, allowing the users to practically cut and paste functionality. The NDoc team is already talking about supporting a Microsoft Help version 2 output target, but it seems Microsoft is not going to support this help format for much longer. The benefit would be that it would be easier to integrate into VS.NET's help system.

Figure 5-7. MSDN NDoc Output.

Listings 5.17 and 5.18. As I mentioned, the links to the .NET SDK documentation were generated automatically. If, however, you want to link to a CHM file yourself, ensure that the CHM file is in the same directory and use the code in Listing 5.20.

Listing 5.20. Linking CHM files with NDoc


<A HREF=">

JavaDoc

JavaDoc (java.sun.com/j2se/javadoc) is probably the most familiar format for the Web, complete with frames similar to Figure 5-8.

Figure 5-8. Javadoc Ouput Format.

[View full size image]

XML

XML output is the most configurable. You can write an XSL Transformation to format it however you want.

LaTeX

LaTeX (www.latex-project.org) is a long time standard for technical documentation. From LaTeX, you can target many outputs, including HTML, PDF, and DocBook (www.docbook.org).

Linear HTML

Similar to Javadoc, Linear HTML outputs an HTML file, but this HTML output does not use frames and contains all documentation in one file.


/ 275