<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Stefano Ricciardi &#187; Ghost-Doc</title>
	<atom:link href="http://stefanoricciardi.com/tag/ghost-doc/feed/" rel="self" type="application/rss+xml" />
	<link>http://stefanoricciardi.com</link>
	<description>On Software Development and Thereabouts</description>
	<lastBuildDate>Tue, 15 Nov 2011 07:57:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>See Your XML Docs As You Type With CR Documentor</title>
		<link>http://stefanoricciardi.com/2010/01/22/see-your-xml-docs-as-you-type-with-cr-documentor/</link>
		<comments>http://stefanoricciardi.com/2010/01/22/see-your-xml-docs-as-you-type-with-cr-documentor/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 19:39:29 +0000</pubDate>
		<dc:creator>stefanoricciardi</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Documentor]]></category>
		<category><![CDATA[Ghost-Doc]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">http://stefanoricciardi.wordpress.com/?p=701</guid>
		<description><![CDATA[Introduction Almost 10 years ago now I used to be a Java developer in Motorola. After a long hiatus in the embedded systems and a job change, I have come back to enterprise development, this time in .Net. I remembered that in the good ol’ days it required 2 steps to see the final rendering [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F01%2F22%2Fsee-your-xml-docs-as-you-type-with-cr-documentor%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F01%2F22%2Fsee-your-xml-docs-as-you-type-with-cr-documentor%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<h3>Introduction</h3>
<p>Almost 10 years ago now I used to be a Java developer in Motorola. After a long hiatus in the embedded systems and a job change, I have come back to enterprise development, this time in .Net.</p>
<p>I remembered that in the good ol’ days it required 2 steps to see the final rendering of the XML documentation: firing javadoc (usually from within an ANT task) and the open up the content in a browser.</p>
<p>I was quite surprised to see that in the .Net area seeing the final output of the docs was not as straightforward as I hoped for. Yes, there was <a href="http://ndoc.sourceforge.net/">NDoc</a> to parse the XML, but its development stopped around 2005 and it’s doesn’t support anything beyond C# 2.0. There’s also <a href="http://www.codeplex.com/Sandcastle">Sandcastle</a>, but to make it work for me it has required a few downloads and a bit of tweaking here and there. And integrating it into my NAnt task had not been that easy either. But somehow in the end I have pulled that out.</p>
<p>Therefore I have been pleasantly surprised when I met <strong>CR Documentor, </strong>a little plug-in for visual studio that let’s you see your XML documentation <em>as you write it</em>. It’s almost like having a WYSIWYG editor, without having to launch Sandcastle, wait for the complete build, and open up the browser.</p>
<h3>Installation</h3>
<ul>
<li><a href="http://code.google.com/p/cr-documentor/"><img style="display:inline;border-width:0;margin:0;" title="cr_documentor-logo" src="http://stefanoricciardi.files.wordpress.com/2010/01/cr_documentorlogo.gif" border="0" alt="cr_documentor-logo" width="100" height="102" align="right" /></a>Requirements:
<ul>
<li>Visual Studio 2005 or greater (I am pretty confident that you need at least a Professional version as opposed to Express). I am running it on Visual Studio Team System 2008, not sure whether it works also on 2010.</li>
<li>The DXCore plugin framework from DevExpress. Possibly the best (and only?) way to get it is to get through the excellent free <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/">CodeRush Xpress for C# and VB</a></li>
</ul>
</li>
<li>Download the plugin: CR Documentor is hosted at Google Code at <a href="http://code.google.com/p/cr-documentor/">this link</a>.</li>
<li>Copy the dll in your DX-Core plugin-folder (<tt>C:\Users\&lt;username&gt;\Documents\DevExpress\IDE Tools\Community\PlugIns</tt>)</li>
<li>Restart Visual Studio</li>
</ul>
<h3>Usage</h3>
<ol>
<li>CR Documentor adds itself in the right click menu, close to the bottom. From the submenu, choose “Show CR_Documentor window”.<a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/cr_documentor1.png"><img style="display:inline;margin-left:0;margin-right:0;border-width:0;" title="CR_documentor-1" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/cr_documentor1_thumb.png" border="0" alt="CR_documentor-1" width="244" height="212" /></a></li>
<li>A new window opens up in floating mode (I prefer to dock-it to the right side together with my solution explorer and luckily the plug-in remembers this choice every time I open the window after closing it and at startup).<a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/image.png"><img style="display:inline;border-width:0;" title="image" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/image_thumb.png" border="0" alt="image" width="244" height="127" /></a></li>
<li>Now every time your cursor is on an XML doc, you can see the preview in the Documentor window. See for example when I put the cursor on the XML doc of a class: I get a complete picture of the documentation for that class and its methods all in real time.<br />
<a href="http://stefanoricciardi.files.wordpress.com/2010/01/image1.png"><img style="display:inline;border-width:0;" title="image" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/image_thumb1.png" border="0" alt="image" width="229" height="244" /></a></li>
<li>There are a few other features that I don’t use very often. All of them are accessible by the right-click content sensitive menu:
<ul>
<li>Expand/Collapse all XML comments in the editor</li>
<li>Insert XML docs templates (<a href="http://stefanoricciardi.com/2009/06/19/must-have-vs-2008-free-plug-ins-2-ghost-doc/">I prefer to use GhostDoc for that</a>).</li>
<li></li>
</ul>
</li>
</ol>
<h3>Configuration</h3>
<p>Like all DXCore plugins, you can access to the configuration by pressing ALT+CTRL+SHIFT+O combination. I like to check all my options to Sandcastle because that’s the tool that I will be using to create the final XML documentation.</p>
<p><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/image2.png"><img style="display:inline;border-width:0;" title="image" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/image_thumb2.png" border="0" alt="image" width="244" height="161" /></a></p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f01%2f22%2fsee-your-xml-docs-as-you-type-with-cr-documentor%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f01%2f22%2fsee-your-xml-docs-as-you-type-with-cr-documentor%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<p><a rev="vote-for" href="http://dotnetshoutout.com/See-Your-XML-Docs-As-You-Type-With-CR-Documentor-Stefano-Ricciardis-Blog"><img style="border:0;" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F01%2F22%2Fsee-your-xml-docs-as-you-type-with-cr-documentor%2F" alt="Shout it" /></a></p>
<p><!-- AddThis Button BEGIN --></p>
<p><a href="http://www.addthis.com/bookmark.php?v=250"><img style="border-width:0;" src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="Bookmark and Share" width="125" height="16" /></a></p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e6ceeafa-fe5c-4bd6-a48d-325da43e5abc" class="wlWriterSmartContent" style="display:inline;float:none;margin:0;padding:0;">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/Programming">Programming</a>,<a rel="tag" href="http://technorati.com/tags/C%23">C#</a>,<a rel="tag" href="http://technorati.com/tags/visual+Studio+2008">visual Studio 2008</a>,<a rel="tag" href="http://technorati.com/tags/Tools">Tools</a></div>

]]></content:encoded>
			<wfw:commentRss>http://stefanoricciardi.com/2010/01/22/see-your-xml-docs-as-you-type-with-cr-documentor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Must have VS 2008 Free Plug-ins (2): Ghost-Doc</title>
		<link>http://stefanoricciardi.com/2009/06/19/must-have-vs-2008-free-plug-ins-2-ghost-doc/</link>
		<comments>http://stefanoricciardi.com/2009/06/19/must-have-vs-2008-free-plug-ins-2-ghost-doc/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 20:29:39 +0000</pubDate>
		<dc:creator>stefanoricciardi</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Ghost-Doc]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">http://stefanoricciardi.wordpress.com/?p=101</guid>
		<description><![CDATA[According to the Wikipedia, a ghostwriter is a professional writer who is paid to write books, articles, stories, reports, or other texts that are officially credited to another person. As the name seems to imply, Ghost-Doc plug-in for Visual Studio is something like that: instead of typing in the XML documentation for your source code [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fstefanoricciardi.com%2F2009%2F06%2F19%2Fmust-have-vs-2008-free-plug-ins-2-ghost-doc%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fstefanoricciardi.com%2F2009%2F06%2F19%2Fmust-have-vs-2008-free-plug-ins-2-ghost-doc%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>According to the Wikipedia, a <em><a href="http://en.wikipedia.org/wiki/Ghostwriter">ghostwriter</a></em> is a</p>
<blockquote><p>professional <a href="http://en.wikipedia.org/wiki/Writer">writer</a> who is paid to write books, articles, stories, reports, or other texts that are officially credited to another person.</p></blockquote>
<p><span>As the name seems to imply, <a href="http://submain.com/products/ghostdoc.aspx">Ghost-Doc</a> plug-in for Visual Studio is something like that: instead of typing in the XML documentation for your source code yourself, Ghost-Doc does the heavy-lifting and fills it for you.</span></p>
<p>Suppose you have a very simple class like the following:</p>
<pre class="brush: csharp; title: ; notranslate">
public sealed class TestGhostDoc
{
    double CalculateVAT(double priceOfGoods, double VATPercentage)
    {
        return (priceOfGoods + priceOfGoods * VATPercentage);
    }
}
</pre>
<p>Now you want to add XML documentation for the CalculateVAT member function. All you have to do is to right-click somewhere on line 3 (I prefer to use the <tt>CTRL + SHIFT + D</tt> since <a href="http://stefanoricciardi.com/2009/06/10/most-useful-visual-studio-2008-keyboard-shortcuts/">I love shortcuts</a>), select “Document This”, and Ghost-Doc will fill the XML documentation for you like the following:</p>
<pre class="brush:csharp">
public sealed class TestGhostDoc
{
    /// &lt;summary&gt;
    /// Calculates the VAT.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;priceOfGoods&quot;&gt;The price of goods&lt;/param&gt;
    /// &lt;param name=&quot;VATPercentage&quot;&gt;The VAT percentage&lt;/param&gt;
    /// &lt;returns&gt;&lt;/returns&gt;
    double CalculateVAT(double priceOfGoods, double VATPercentage)
    {
        return priceOfGoods += priceOfGoods * VATPercentage;
    }
}
</pre>
<p>As you can see, Ghost-Doc, beside filling the structure for you, also fills the contents using a set of rules based on the order of the words (the only thing that is left is filling the content of the <tt>returns</tt> tag). Note that words are recognized successfully only if you use the recommended Camel and Pascal casing appropriately (which you ought to be doing anyway because you <a href="http://stefanoricciardi.com/2009/06/12/must-have-vs-2008-free-plug-ins-1-style-cop/">follow to the naming conventions</a>).</p>
<p>Member functions is not the only place where you can use Ghost-Doc: class names, constructors, enums, properties, event, etc… they are all supported as expected.</p>
<pre class="brush:csharp">
namespace TestGhostDoc
{
    /// &lt;summary&gt;
    ///
    /// &lt;/summary&gt;
    public sealed class User
    {
        /// &lt;summary&gt;
        /// Gets or sets the first name.
        /// &lt;/summary&gt;
        /// &lt;value&gt;The first name.&lt;/value&gt;
        public string FirstName { get; set;  }

        /// &lt;summary&gt;
        /// Gets the address.
        /// &lt;/summary&gt;
        /// &lt;value&gt;The address.&lt;/value&gt;
        public string Address { get; }
    }
}
</pre>
<p>Can you spot the difference between the documentations of the two properties that Ghost-Doc has generated?</p>
<h3>Advanced use</h3>
<p>Ghost-Doc has a complete customization window:<br />
<a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2009/06/ghostdoc.png"><img style="display:inline;border-width:0;" title="GhostDoc" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2009/06/ghostdoc_thumb.png" border="0" alt="GhostDoc" width="490" height="397" /></a></p>
<p>In these tabs you can</p>
<ul>
<li>modify/add templates that Ghost-Doc uses to document a language element</li>
<li>define your own acronyms, that will always be rendered in all-caps by Ghost-Doc, even if you have written them in lower case inside a language element name to be compliant to the naming conventions</li>
<li>modify/add the list of words which define qualities, that Ghost-Doc will reorder in a special way. For example, since <em>size</em> is on this special list &#8220;FileBufferSize will be worded as “the size of the file buffer” instead of “the file buffer size” .</li>
<li>modify/add the list of words that shall never be preceded by “the” (the so called “no the” words).</li>
<li>Modify the way <em>true</em>, <em>false</em>, and <em>null </em>keywords are represented</li>
<li>Create a custom text that will be appended to all comments the first time they are created; this text can optionally be dynamic and include the name of the author, or the current date, etc.. (this would be a bit over the top IMHO since it would be repeated for each and every function, property, etc…).</li>
</ul>
<p>With Ghost-Doc, you have no more excuses not to write complete and accurate XML source code documentation!<br />
<!-- AddThis Button BEGIN --><br />
<a href="http://www.addthis.com/bookmark.php?v=250"><img style="border:0;" src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="Bookmark and Share" width="125" height="16" /></a><br />
<!-- AddThis Button END --></p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e6ceeafa-fe5c-4bd6-a48d-325da43e5abc" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/Programming">Programming</a>, <a rel="tag" href="http://technorati.com/tags/C%23">C#</a>, <a rel="tag" href="http://technorati.com/tags/visual+Studio+2008">Visual Studio 2008</a>, <a rel="tag" href="http://technorati.com/tags/plugin">Plugin</a>, <a rel="tag" href="http://technorati.com/tags/Tools">Tools</a></div>

]]></content:encoded>
			<wfw:commentRss>http://stefanoricciardi.com/2009/06/19/must-have-vs-2008-free-plug-ins-2-ghost-doc/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

