<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>7.3. Writing CloudStack Documentation</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta name="generator" content="publican 2.8" /><meta name="package" content="Apache_CloudStack-Developers_Guide-4.1.0-it-IT-1-" /><script type="text/javascript" src="../../../../../toc.js"></script><script type="text/javascript">
              addID('Apache_CloudStack');
              
	      addID('Apache_CloudStack.4.1.0');
              
              addID('Apache_CloudStack.4.1.0.books');
	      addID('Apache_CloudStack.4.1.0.Developers_Guide');
              </script><link rel="home" href="index.html" title="Manuale dello Sviluppatore CloudStack" /><link rel="up" href="working-with-documentation.html" title="Capitolo 7. Preparing and Building CloudStack Documentation" /><link rel="prev" href="building-documentation.html" title="7.2. Building CloudStack Documentation" /><link rel="next" href="building-translation.html" title="7.4. Translating CloudStack Documentation" /></head><body class="toc_embeded "><div id="tocdiv" class="toc"><iframe id="tocframe" class="toc" src="../../../../toc.html">This is an iframe, to view it upgrade your browser or enable iframe display.</iframe></div><p id="title"><a class="left" href="http://cloudstack.apache.org"><img src="Common_Content/images/image_left.png" alt="Product Site" /></a><a class="right" href="http://cloudstack.apache.org/docs"><img src="Common_Content/images/image_right.png" alt="Documentation Site" /></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="building-documentation.html"><strong>Indietro</strong></a></li><li class="next"><a accesskey="n" href="building-translation.html"><strong>Avanti</strong></a></li></ul><div xml:lang="it-IT" class="section" id="writing-new-documentation" lang="it-IT"><div class="titlepage"><div><div><h2 class="title" id="writing-new-documentation">7.3. Writing CloudStack Documentation</h2></div></div></div><div class="para">
		CloudStack documentation is written in DocBook xml format. Each guide defined with a publican configuration file refers to a DocBook <span class="emphasis"><em>book</em></span>.
	</div><div class="para">
		These books are defined in xml files in docs/en-US, for instance if we look at the Developers guide, its configuration file contains:
	</div><pre class="programlisting">
        xml_lang: en-US
        type: Book
        docname: Developers_Guide
        brand: cloudstack
        chunk_first: 1
        chunk_section_depth: 1
</pre><div class="para">
		The <span class="emphasis"><em>docname</em></span> key gives you the basename of the DocBook file located in the en-US directory that contains the description of the book.
	</div><div class="para">
		Looking closely at Developers_Guide.xml we see that it contains <span class="emphasis"><em>book</em></span> tags and several references to other xml files. These are the chapters of the book, currently they are:
	</div><pre class="programlisting">
    
        &lt;xi:include href="concepts.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
        &lt;xi:include href="building-with-maven.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
        &lt;xi:include href="developer-introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
        &lt;xi:include href="whats-new.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
        &lt;xi:include href="api-calls.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
        &lt;xi:include href="working-with-usage-data.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
        &lt;xi:include href="working-with-documentation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
        &lt;xi:include href="tools.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
        &lt;xi:include href="event-types.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
        &lt;xi:include href="alerts.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
        &lt;xi:include href="time-zones.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
        &lt;xi:include href="Revision_History.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
    
</pre><div class="para">
		All these xml files are written in DocBook format.
	</div><div class="note"><div class="admonition_header"><h2>Nota</h2></div><div class="admonition"><div class="para">
			DocBook format is well <a href="http://www.docbook.org/tdg5/en/html/docbook.html">documented</a>, refer to the documentation for any questions about DocBook tags
		</div></div></div><div class="para">
		When writing documentation, you therefore need to located the book,chapter and section of the content you want to write/correct. Or create a new book,chapter,section.
	</div><div class="para">
		You will then learn much more about DocBook tagging. In order to write this chapter about documentation, I added the <span class="emphasis"><em>working-with-documentation.xml</em></span>file describing a chapter in the Developer book and I created several sections within that chapter like so:
	</div><pre class="programlisting">
    
        &lt;chapter id="working-with-documentation"&gt;
            &lt;title&gt;Preparing and Building CloudStack Documentation&lt;/title&gt;
            &lt;para&gt;This chapter describes how to install publican, how to write new documentation and build a guide as well as how to build a translated version of the documentation using transifex&lt;/para&gt;
            &lt;xi:include href="installing-publican.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
            &lt;xi:include href="building-documentation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
            &lt;xi:include href="writing-new-documentation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
            &lt;xi:include href="building-translation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /&gt;
        &lt;/chapter&gt;
    
</pre><div class="para">
		Note the id witin the chapter tag, it represents the basename of the xml file describing the chapter.
	</div><div class="para">
		For translation purposes it is important that this basename be less than 50 characters long.
	</div><div class="para">
		This chapter also refers to xml files which contains each section. While you could embed the sections directly in the chapter file and as a matter of fact also write the chapters within a single book file. Breaking things up in smaller files at the granularity of the section, allows us to re-use any section to build different books.
	</div><div class="para">
		For completeness here is an example of a section:
	</div><pre class="programlisting">
    
        &lt;section id="building-documentation"&gt;
            &lt;title&gt;Building CloudStack Documentation&lt;/title&gt;
            &lt;para&gt;To build a specific guide, go to the source tree of the documentation in /docs and identify the guide you want to build.&lt;/para&gt;
            &lt;para&gt;Currently there are four guides plus the release notes, all defined in publican configuration files:&lt;/para&gt;
            &lt;programlisting&gt;
               publican-adminguide.cfg
               publican-devguide.cfg
               publican-installation.cfg
               publican-plugin-niciranvp.cfg
               publican-release-notes.cfg
            &lt;/programlisting&gt;
            &lt;para&gt;To build the Developer guide for example, do the following:&lt;/para&gt;
            &lt;programlisting&gt;publican build --config=publican-devguide.cfg --formats=pdf --langs=en-US&lt;/programlisting&gt;
            &lt;para&gt;A pdf file will be created in tmp/en-US/pdf, you may choose to build the guide in a different format like html. In that case just replace the format value.&lt;/para&gt;
        &lt;/section&gt;
    
</pre><div class="para">
		Happy Publicating and DocBooking.
	</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="building-documentation.html"><strong>Indietro</strong>7.2. Building CloudStack Documentation</a></li><li class="up"><a accesskey="u" href="#"><strong>Risali</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Partenza</strong></a></li><li class="next"><a accesskey="n" href="building-translation.html"><strong>Avanti</strong>7.4. Translating CloudStack Documentation</a></li></ul></body></html>
