Jump to: navigation, search

Difference between revisions of "Documentation/HowTo"

(Replaced content with "Read the new content in the [http://docs.openstack.org/contributor-guide/index.html Documentation Contributor Guide]. {{OpenStack_Documentation_Navbar}} ---- Category:...")
 
(353 intermediate revisions by 45 users not shown)
Line 1: Line 1:
__NOTOC__
+
Read the new content in the [http://docs.openstack.org/contributor-guide/index.html Documentation Contributor Guide].
= How To Work on [[OpenStack]] Documentation =
+
{{OpenStack_Documentation_Navbar}}
  
At the core of OpenStack is the community and collaboration that we do - the same rules for the code apply to documentation too. Ideally any code contribution that is merged into the base has documentation to go with it. Anne Gentle is the coordinator for all documentation efforts, both community-based and "official" docs. This page describes the methods we use to create the basis for world-class documentation for OpenStack developers and users.
 
  
== Tools Overview ==
+
----
 
+
[[Category:Documentation]]
Currently, we use this wiki, RST files stored in source code, ([http://docutils.sourceforge.net/docs/user/rst/quickref.html ReStructured Text], it has a similar text-based markup as wikitext) and [[DocBook]] to create OpenStack's web documentation.
 
 
 
The wiki is easy-peasy, you just create an account on wiki.openstack.org, create a new page, and start editing.
 
 
 
Editing RST or DocBook has a few more steps. If you're on Mac or Linux (Ubuntu for example), you create a Launchpad account, install Bazaar (see http://wiki.openstack.org/LifeWithBzrAndLaunchpad) and get the code so you can work on .rst or .xml files in the doc directory in any project, namely nova, swift, glance, or openstack-manuals. To work on the DocBook source files, a working project exists in Launchpad in the openstack-manuals project since DocBook documentation encompasses all three OpenStack projects.
 
 
 
The RST source is built into html using Sphinx so that it gets displayed on [http://nova.openstack.org nova.openstack.org], [http://swift.openstack.org swift.openstack.org], and [http://glance.openstack.org glance.openstack.org].
 
 
 
The [[DocBook]] source is built into html (webhelp) and PDF using XSLT transforms included with the [[DocBook]] project.
 
 
 
A super light-weight drafting option, easy as a click-through, is to write with other collaborators on an Etherpad at http://etherpad.openstack.org/. We can invite others as we go, and choose to write it as wikitext, RST, or docbook.
 
 
 
 
 
<pre><nowiki>#!rst
 
 
 
wiki.openstack.org  (wikitext or RST)
 
-------------------------------------
 
 
 
The OpenStack wiki contains draft documentation but should ideally contain project docs, specs, doc drafts, and outlines. Any dev or user doc on the wiki is subject to constant change so if there's a page you want to keep an eye on (like Nova installations for example), add it to your Notifications list (under User > Settings > Notifications in the wiki). I've also begun a copy/paste effort to put RST in wiki pages to avoid multiple maintenance on pages that are also housed on nova.openstack.org, for example. There are great pages on the wiki that I want to take to the other doc sites, for example the Nova deploy page on the wiki should be highlighted in other locations as well.
 
 
 
nova.openstack.org, swift.openstack.org, glance.openstack.org (RST)
 
-------------------------------------------------------------------
 
The RST pages stored with the project code should be written with a developer audience in mind, although many times you'll find there is overlap in what an admin needs to know and what a developer needs to know. High priorities for those sites are wider coverage of doc strings, API doc, i18N methodology, and architecture concepts that'll help developers.
 
 
 
docs.openstack.org (DocBook)
 
----------------------------
 
The source for this site is housed in a Launchpad project at http://launchpad.net/openstack-manuals. You can either build the output locally if you want or just submit changes to the source XML through merge proposals. The !OpenStack Jenkins build server builds the doc and copies the output to docs.openstack.org/trunk automatically thanks to the pom.xml files included in the source files.
 
 
 
* doc/source/docbkx contains the DocBook XML source files and images
 
* doc/build/mvnbuild contains the OpenStack transforms to create the PDF and HTML using pom.xml build file
 
 
 
I can also build to docs.openstack.org/cactus URL to keep Cactus updated during the entire release cycle, but the automated builds go to /trunk.
 
 
 
Versions of Doc
 
---------------
 
For RST-based documentation, you can get to a point-release of a docs site by going to http://swift.openstack.org/1.1, for example. We'll keep doing that for ongoing releases. For Swift, we now have archived sites for the 1.4.0 and 1.4.1 release at swift.openstack.org/1.4.0 and swift.openstack.org/1.4.1. To make those archived sites, you can run a build on the Jenkins server at http://jenkins.openstack.org/view/Swift/job/swift-docs-archive/ and enter the version number and the Launchpad branch that you want to use to build the archived site. For DocBook documentation, the Continuous Integration work keeps docs building to docs.openstack.org/trunk.
 
 
 
</nowiki></pre>
 
 
 
 
 
== Audiences and Targets ==
 
 
 
OpenStack has three main projects - Compute (nova), Object Storage (swift), and now an imaging service (glance). While the goals you'd achieve using each project vary, the three projects can also be used together. Those three projects have two basic audiences - developers and sysadmins (think operations or dev-ops). The RST-based documentation, because it automatically generates doc from docstrings in the code, is much more for a developer audience. There are two types of developers that the developer documentation serves - Python developers who want to work on OpenStack code, and web developers who work with the OpenStack API.
 
 
 
== Workflow ==
 
 
 
The workflow for documentation matches the workflow for code - you download a branch, work on it locally, then commit the changes and propose a merge. Your changes are merged into the main, published doc base, and the doc is built to its varying outputs.
 
 
 
=== Detailed Workflow with BZR and Launchpad ===
 
 
 
The page I always refer to for using BZR and Launchpad for daily tasks is
 
http://wiki.openstack.org/LifeWithBzrAndLaunchpad
 
 
 
Launchpad takes some startup work. First, you make an account, and upload a public key. Then, you identify your Launchpad account to the bzr command line and away you go.
 
 
 
Here's a sample for the documentation project specifically, once you get the Launchpad account set up.
 
 
 
Create the directory where you want to store the doc source files, then switch to it.
 
 
 
 
 
<pre><nowiki>
 
mkdir ~/src/openstack-manuals
 
 
 
cd ~/src/openstack-manuals
 
</nowiki></pre>
 
 
 
 
 
Identify yourself to bzr:
 
 
 
<pre><nowiki>
 
bzr whoami "Mark Pacer <pace@domainname.com>"
 
</nowiki></pre>
 
 
 
bzr lp-login markpacer
 
 
 
Next, initialize the repository as the /openstack-manuals/ directory for that project.
 
 
 
<pre><nowiki>
 
bzr init-repo .
 
</nowiki></pre>
 
 
 
 
 
Now you can check out all the files for the doc project:
 
 
 
<pre><nowiki>
 
bzr branch lp:openstack-manuals trunk
 
</nowiki></pre>
 
 
 
 
 
Next, branch trunk to another working branch:
 
 
 
<pre><nowiki>
 
bzr branch trunk working
 
</nowiki></pre>
 
 
 
Switch to the working directory and edit files in the working directory. When you're done, if you've added any files do this in the working directory:
 
 
 
<pre><nowiki>
 
bzr add
 
</nowiki></pre>
 
 
 
Next, you commit your changes with a message that'll be displayed in Launchpad, creating a change set:
 
 
 
<pre><nowiki>
 
bzr commit -m 'Here's what I did in this set of changes'
 
</nowiki></pre>
 
 
 
Next, push your changes to Launchpad with:
 
 
 
<pre><nowiki>
 
bzr push lp:~markpacer/openstack-manuals/working
 
</nowiki></pre>
 
 
 
Go to the Launchpad site itself to request a merge with the openstack-manuals project, such as https://code.launchpad.net/~markpace/openstack-manuals/working. Click "Propose for Merging" on that page. This sends an email to the project owners, they review the changes, and then you'll see any comments the editors have for you. If you need to make any changes, go to the files in your working directory, and repeat the commit and push steps after making edits.
 
 
 
To generate the PDF and webhelp within your local environment, install Maven. To run the pom file within the mvnbuild directory, which builds the Maven mojo, you run mvn install. Then, switch to the doc/ directory, and run mvn generate-sources using that pom.xml, to build the docs themselves.
 
 
 
You may need a modified settings.xml and if you already have M2_HOME set, you might see an error about "java.lang.[[ClassNotFoundException]]: org.codehaus.plexus.classworlds.launcher.Launcher" - just run unset M2_HOME.
 
 
 
== Translation ==
 
 
 
Translation efforts should occur either in the Launchpad Translations area (for strings in the code, error messages and the like) or on the wiki, which has translations enabled.
 

Latest revision as of 19:25, 26 October 2015

Read the new content in the Documentation Contributor Guide.