Ghstdoc2.1.1 User Manual

Source: Internet
Author: User

 

Directory

Ghstdoc2.1.1 User Manual 1

Directory 2

Modify history 3

1. Introduction to ghostdoc1.2.1 4

2. Installation (for vs2005) 4

3. Configure 8

2.1 initial settings 8

2.2. ghostdoc configuration 11

2.3. hotkey setting 12

4. Use ghostdoc to generate comments for the code 15

4. Code comment specification 20

1. Introduction to ghostdoc1.2.1

Ghostdoc is an XML document comment Generator Based on Visual Studio. Compared with ndoc, ghostdoc can automatically generate a large number of annoying similar descriptions.

2. Installation (for vs2005)

Before installation, disable visual studio2005 and double-click ghostdoc2.1.1.msi.

 


 

Click "Next ":

 


 

Select "I agree" and click "Next ":

 


 

Select the path to install and click "Next ":

 


 

Click "Next" to start installation:

 


 

After the installation is complete, the following window appears. Click "close" to complete the installation:

 


 

3. Configuration
2.1 initial settings

Open Visual Studio 2005 and a dialog box appears, such:

 


 

You can set the hotkey here and click "Assign". If you do not know what to set the hotkey, or the hotkey to be set is not in the drop-down menu, click "Skip" and set it again. Click "Skip" here, for example:

 


 

If ghostdoc is installed for the first time, click "CREATE". If you want to load an existing structure, click "import" (click "CREATE" here "). The following window is displayed:

 


Click "finish" to go to the Visual Studio 2005 page, for example:

 


 

A "ghostdoc" option appears in the drop-down menu of "tool", for example:

 


The "document this" command appears in the right-click menu, for example:

 


 

2.2 configure ghostdoc

On the menu bar of visual studio2005, select "tool | ghostdoc | configure ghostdoc". The displayed dialog box is as follows:


The property page is as follows:

1. Modify, delete, and add text generation rules for rules

2. Acronyms specifies which words are considered as Acronyms

3. "of the" reordering specifies the words that trigger the re-sorting.

4. "No the" words specifies which words are not used before ""

5. Options other options for ghostdoc Configuration

2.3. hotkey settings

Open the "tool | option" of Visual Studio 2005, such:

 


 

In the pop-up dialog box, select "Environment | keyboard" in the Left box, for example:


 

In the keyboard definition area on the right, enter "ghost" in the input column of "display command inclusion (c):", for example:

 

 

In "new shortcut key for (n):", select "Text Editor" and press the shortcut key (p) in the "Next ): "press the shortcut key you want to set (CTRL + Shift + D here), for example:

 

Click "allocate", and then click "OK". For example:

 

 

4. Use ghostdoc to generate comments for the code

Ghostdoc installs a new command for the code editor in Visual Studio. When editing a file, you only need to place the cursor inside the method or attribute of the document to be added, and then use the hotkey (CTRL + Shift + d by default during initialization) or right-click the "document this" menu item in the menu to call the command, ghostdoc inserts a comment in XML format.

Here we will use a demo Code provided by ghostdoc to introduce it (double-click the ghostdoc2.1.1demoproject under the same directory as the installation file. msi, the installation process is the same as "1 installation, after the installation is complete, an "open demo C # project" option will appear in the "Start | all programs | weigelt | ghostdoc for VS 2005" directory, for example:


)

Open "Open demo C # Project", for example:

 


 

Place the cursor inside the method or attribute of the document to be added (note that it must be internal). For example, to comment out the fullfilename method in the demo, place the cursor inside the "{…}" of the fullfilename method "{......} "Or method name, such:

 


 

Then use the hotkey (CTRL + Shift + d by default during initialization, if Initialization is not set, refer to the settings below) or the "document this" menu item in the context menu to call the command, ghostdoc inserts a comment in XML format, for example:

 


 

Of course, you can also type "//" in front of a method or attribute to achieve a similar effect, for example, to comment on the justtesting method:


 

However, the latter can only create an empty comment structure, while ghostdoc can generate most practical comments, such as comparison:

 


 

Note that the quality of ghostdoc annotation generation depends largely on the quality of the identifier name, And ghostdoc cannot generate a comment for the entire code file at one time, you can only generate comments for a member each time. This design is because you need to check every comment it generates.

4. Code comment specifications

Ghostdoc actually does not understand English. Why is the documentation generated by ghostdoc often quite satisfactory? The basic principle is quite simple. ghostdoc assumes that your Code complies with the design specifications of Microsoft class library developers:

1. Your code uses the Pascal or camel naming method to name an identifier consisting of multiple words

2. Your method name usually starts with a verb

3. You do not use abbreviations in identifiers

If you can comply with these rules (for example, use javasache () instead of clrcch () and use self-explanatory identifiers, then ghostdoc can be used, it divides identifiers into several words and combines them to generate comments. It may not be perfect, but it gives you a good start.

Custom Rules and templates are used for text generation, except for built-in rules, you can also define new custom rules to expand or replace existing rules (provide higher priority for your custom rules or disable built-in rules ).

As mentioned above, ghostdoc does not understand English, but it will try to use a mechanism to improve the quality of annotation generation:

1. verb Processing Mechanism (ghostdoc assumes that the first word of the method name is a verb): Add-> adds, do-> does, specify-> specifies;

2. "of the" sorting Organization Mechanism: columnwidth-> width of the column.

3. Special merge mechanisms for some special adjectives: for example, maximumcolumnwidth-> maximum

Width of the column instead of width of the maximum Column

4. automatically checks constants composed of abbreviations and processes other abbreviations using a list.

5. Use a word list to determine when "the": additem-> adds the item, buildfromscratch-> builds from scratch

The following are examples of the application of ghostdoc:

Is it amazing and accurate !!!

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.