<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>vcsjones : Tools</title><link>http://msmvps.com/blogs/vcsjones/archive/tags/Tools/default.aspx</link><description>Tags: Tools</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>DocBook</title><link>http://msmvps.com/blogs/vcsjones/archive/2008/05/23/docbook.aspx</link><pubDate>Fri, 23 May 2008 07:24:34 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1626326</guid><dc:creator>vcsjones</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/vcsjones/rsscomments.aspx?PostID=1626326</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/vcsjones/commentapi.aspx?PostID=1626326</wfw:comment><comments>http://msmvps.com/blogs/vcsjones/archive/2008/05/23/docbook.aspx#comments</comments><description>&lt;p&gt;Let&amp;#39;s take a break from the text encoding idea real quick so I can talk about a new tool that I recently got into..&lt;/p&gt; &lt;p&gt;One of the things that every product needs, regardless of how simple it is to use, is good documentation. It&amp;#39;s not fun, it takes time, and isn&amp;#39;t technically intriguing. Regardless, it has to be done. The part that myself and team members have struggled with is a tool take makes it easy. We looked at a few commercial applications such as RoboHelp, but it always left me the impression we were rabbit hunting with a Barrett M107 .50 rifle. Our requirements were pretty simple:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Easy to use  &lt;li&gt;Text based - This makes differentials and merging easy  &lt;li&gt;Reasonably priced  &lt;li&gt;Able to produce different types of documents (HTML, PDF, etc)&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;img style="border-right:0px;border-top:0px;margin:0px 0px 0px 10px;border-left:0px;border-bottom:0px;" border="0" alt="penandpaper" align="right" src="http://msmvps.com/blogs/vcsjones/WindowsLiveWriter/DocBook_2FF4/penandpaper_3.jpg" width="196" height="149" /&gt; We finally settled on what is the best solution (not to mention, it&amp;#39;s open source and free) called DocBook. It&amp;#39;s based on XML, and does have a standard. XML is extremely flexible, and their output is generated by XSL transformations, so we can easily customize the output to meet our requirements. We started using the e-novative DocBook Environment, which gives you a simple command line environment for compiling your DocBook books. It too uses a GPL license, so you can customize it to your needs.&lt;/p&gt; &lt;p&gt;A simple book looks something like this:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="html"&gt;xml&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;encoding&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;utf-8&amp;quot;&lt;/span&gt;?&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="html"&gt;DOCTYPE&lt;/span&gt; &lt;span class="attr"&gt;book&lt;/span&gt;
  &lt;span class="attr"&gt;PUBLIC&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;quot;-//OASIS//DTD DocBook XML V4.2//EN&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;quot;file:/c:/docbook/dtd/docbookx.dtd&amp;quot;&lt;/span&gt;
  [
    &amp;lt;!&lt;span class="attr"&gt;ENTITY&lt;/span&gt; % &lt;span class="attr"&gt;global&lt;/span&gt;.&lt;span class="attr"&gt;entities&lt;/span&gt; &lt;span class="attr"&gt;SYSTEM&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;quot;file:/c:/docbook/include/global.xml&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    %global.entities;

    &lt;span class="kwrd"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="html"&gt;ENTITY&lt;/span&gt; % &lt;span class="attr"&gt;entities&lt;/span&gt; &lt;span class="attr"&gt;SYSTEM&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;quot;entities.xml&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    %entities;
]
&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;book&lt;/span&gt; &lt;span class="attr"&gt;lang&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;en&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;bookinfo&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;My First Book&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;pubdate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;May, 2008&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;pubdate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;copyright&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;year&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;2008&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;year&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;holder&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Kevin Jones&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;holder&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;copyright&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;bookinfo&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;chapter&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;My First Chapter&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;sect1&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;How to crash a .NET Application&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;para&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Call System.AppDomain.Unload(System.AppDomain.CurrentDomain)&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;para&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;sect1&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;chapter&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;book&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Pretty simple, right? Each book can be broken down into separate chapters, which are broken down into sections, then paragraphs. It takes care of some dirty work for you, such as maintaining a Table of Contents for you. It offers a lot of other standard features as well, embedding graphics, referencing other places in the document.&lt;/p&gt;
&lt;p&gt;Since DocBook is capable of understanding external entities, I can place chapters, sections, any part of the document that I want into another file and create an &amp;lt;!ENTITY ... &amp;gt; for it.&lt;/p&gt;
&lt;p&gt;Compiling it is pretty easy. From the e-novative environment, just use the docbook_html.bat for docbook_pdf.bat to create your generated output, something like this:&lt;/p&gt;
&lt;p&gt;&amp;gt;C:\docbook\bat\docbook_html.bat MyFirstBook&lt;/p&gt;
&lt;p&gt;MyFirstBook is the name of the project in the projects folder, which is all automatically created for you by the docbook_create.bat script. Using the compiler, the out-of-box HTML template looks like this:&lt;/p&gt;
&lt;p style="font-size:8pt;text-align:center;"&gt;&lt;a href="http://msmvps.com/blogs/vcsjones/WindowsLiveWriter/DocBook_2FF4/docbookhtmloutput_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" border="0" alt="docbookhtmloutput" src="http://msmvps.com/blogs/vcsjones/WindowsLiveWriter/DocBook_2FF4/docbookhtmloutput_thumb.jpg" width="244" height="147" /&gt;&lt;/a&gt; &lt;br /&gt;(click for full image)&lt;/p&gt;
&lt;p&gt;There you have it, a simple documentation tool. Not very pretty at the moment, but of course it&amp;#39;s easy enough to theme it to your company or product by changing the XSL.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1626326" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/vcsjones/archive/tags/Tools/default.aspx">Tools</category></item></channel></rss>