. NET Platform Open Source project Quick glance (4). NET document Generation tool ADB and use

Source: Internet
Author: User

Reprinted from Http://www.cnblogs.com/asxinyu/p/dotnet_Opensource_project_ADB_CSharpDocument.html

Read Catalogue

    • 1.ADB Introduction
    • 2.ADB Generating. NET document procedures
    • 3. Resources and Code

A long time ago, the ADB tool was used to build the project's help documentation. Powerful, in the process of learning some open source projects, the official does not provide CHM help documentation, so in order to quickly understand the project structure and comments. Create a document to see for yourself, very useful. This is also a learning method. For example this document is in:

. NET Platform Open Source project Quick glance (2) Compare. NET Objects Object comparison component

. NET Platform Open Source project Quick glance (3) compact and lightweight NoSQL file database Litedb

The CHM help document was manually created in the last resource in the 2 articles above. Sometimes we can also translate the source code, re-production, the effect is good. The ADB tool introduced today, I am using an improved version based on the X component. I'm not sure about the details of the improvement, it's very handy anyway. Here's a look at the introduction and how to use it.

. NET Open Source directory: "Directory" of this blog other. NET open source project articles Directory

The original address of this article:. NET Platform Open Source project Quick glance (4). NET document Generation tool ADB and use

Back to directory 1. ADB introduction

Program annotations play a significant role in program authoring and maintenance, and in Visual C #, you can create a document for your code by including the XML tag directly in the Special comment field of the source code, before the code block that the XML tag refers to. When the compiler compiles, it searches all the XML tags in the source code and creates an XML document file. The Net Document Generation tool (hereinafter referred to as ADB) creates an API document in the form of MSDN by reflecting the XML annotations in the assembly and its code.

The ADB document Generation tool is an open source tool developed by the blog Park Lou Spring City, and the project's introductory URL is:

Http://www.cnblogs.com/lucc/archive/2008/09/01/1281085.html

Note: The software requires the Microsoft HTML Help Workshop to be installed first, with the following main functions:

(1) Generate a document of a style similar to MSDN based on the assembly and its corresponding XML document file, and package it as a CHM file;

(2) Merging documents corresponding to multiple assemblies into one document;

(3) An XML document that automatically searches for an assembly and the assemblies it references (including the. NET-brought assemblies, such as: System.Xml);

(4) Flexibility to control which members are displayed in the document (e.g., generate public methods only);

(5) Friendly interface, easy to operate.

(6) Users can expand the XML logo according to their needs;

(7) Users can write custom document generators according to their own needs.

ADB official offers the latest version is 2.3, you can go to the above link to download the latest version, I am here to share is @ Big Stone using the X component recompile version.

Back to Directory 2. ADB generates. NET Document procedures

The use of the process is divided into 3 steps:

2.1. NET Project code comments

The ADB code generation is generated primarily based on the comments of the project. For example, markup for comments in C #:

123456789 /// <summary>获取指定数组中,满足范围的比例</summary>/// <param name="data">目标数据</param>/// <param name="L">下限</param>/// <param name="H">上限</param>publicstaticdoubleFindPrecent(this IEnumerable<Int32> data, Int32 L, Int32 H){    vart = (double)data.Where(n => n >= L && n <= H).Count();    returnt / (double)data.Count(); }

Of course there are more marker symbols, such as example,code,see and so on. If you want to do a perfect help document, the better the details, the more powerful the document will be.

2.2 Project Setup and build

Before the project is compiled, to verify that the XML file is generated, open the output node, build-on project properties, such as:

Confirm the option to tick the XML document file. Generated is based on the comments of this XML.

2.3 adb using the Generate CHM document

Open adb software, I provide 2 versions of the download in the 3rd section, if you need to compile other versions yourself, open the ADB software, such as:

After entering the title, add the DLL file of the document you want to generate, and you can add more than one, and then if you generate the corresponding XML file, it will be loaded in automatically. Otherwise you will get an error. Such as:

You can also add only the types and methods you want. General non-public types may not be added. The last point "Create document" is OK, it will generate the directory to your XML file.

Note 2 small questions: Your CHM file title to standardize a little, what # number,: number, etc. do not add up, or will error, sometimes very headache ... Often forget this one, and sometimes more than just do, it is wrong. As shown, the title is problematic:

Well, don't say, say more is tears. Here's a look at some of the documents I've generated:

Good effect Oh ... Try it quickly.

Back to Catalog 3. Resources and Code

I sent here is the X component modified version of the source code, thanks @ Lou Spring City, @ Big Stone, I just soy sauce, share it out.

Update to the address of the blog Park: Microsoft HTML Help Workshop download

ADB x Component version Source: Adb_src.rar

ADB. NET 4.0 Version: Adb_4.0.rar

ADB. NET 4.5 Version: Adb_4.5.rar

People mostly, if the DLL is not the above 2 versions, you might want to compile it yourself. If there is a problem, timely message, I will give you to solve, there may be some minor problems. Since I installed it, the basic build is good. There is no problem, no guarantee that everyone has a problem ah. Thank you very much taketry found a problem:


Most people install HTML Help Workshop will default to the C drive,
When I install HTML help Workshop to the D drive, I generate a report that "the system cannot find the file specified."

In the source code, the Createchm () method
"_hhcprocess.startinfo.filename = _defaulthhcpath;", _defaulthhcpath changed to Hhcpath can be generated normally.
If you feel that reading this article is helpful to you, please click " recommend " button, your "recommendation" will be my biggest writing motivation! Welcome to reprint, but without the author's consent, reprint article must be in the article page obvious location to the author and the original link , otherwise reserve the right to pursue legal responsibility.

. NET Platform Open Source project Quick glance (4). NET document Generation tool ADB and use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.