Commit d17e74b4 authored by Iustin Pop's avatar Iustin Pop

Switch the documentation to sphinx

This big patch converts the documentation build system to sphinx
( Since that uses reStructuredText sources
too, there is no change (yet) in the documents themselves, just in the
build system.

As before, the docs are pre built by the maintainer, and the end-user
doesn't need sphinx or other rst tools to build the docs. Note that we
are not distributing PDFs, so building that will require the tools.

The docs will be stored under doc/html and the build system also need an
extra directory doc/build. These are considered (by automake)
maintainer-related objects and are removed at maintainer-clean time.

The patch also fixes some small issues: add a docpng variable, add
doc/api (also generated by maintainer) in maintainer-clean-local, etc.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarGuido Trotter <>
parent 6d81475c
......@@ -32,11 +32,10 @@
# doc
# doc/examples
......@@ -7,8 +7,8 @@ Build dependencies
Most dependencies from INSTALL, plus:
- docbook2html, docbook2man from Docbook tools
- rst2html from Docutils
- python-sphinx (tested with version 0.6.1) from
- graphviz
......@@ -16,6 +16,9 @@ Most dependencies from INSTALL, plus:
Configuring for development
sh && \
./configure PYTHON=python2.4 --enable-maintainer-mode \
--prefix=/usr/local --sysconfdir=/etc --localstatedir=/var
Run the following command (only use ``PYTHON=...`` if you need to use a
different python version)::
sh && \
./configure PYTHON=python2.4 \
--prefix=/usr/local --sysconfdir=/etc --localstatedir=/var
......@@ -56,6 +56,7 @@ Before initialising the cluster, on each node you need to create the following
- /etc/ganeti
- /var/lib/ganeti, /var/log/ganeti
- /srv/ganeti, /srv/ganeti/os, /srv/ganeti/export
After this, use ``gnt-cluster init``.
......@@ -37,10 +37,12 @@ DIRS = \
$(dochtml) \
$(patsubst,%.png,$(docdot)) \
$(docpng) \
-rm -rf doc/api doc/build doc/html
autotools/replace_vars.sed \
devel/upload \
......@@ -111,18 +113,28 @@ docrst = \
doc/design-2.0.rst \
doc/hooks.rst \
doc/iallocator.rst \
doc/index.rst \
doc/install.rst \
doc/rapi.rst \
dochtml = $(patsubst %.rst,%.html,$(docrst))
doc/html: $(docrst) $(docpng) doc/
@test -n "$(SPHINX)" || \
{ echo 'sphinx-build' not found during configure; exit 1; }
mkdir -p doc/build/doctrees
PYTHONPATH=.:$(top_builddir) sphinx-build -q -b html \
-d doc/build/doctrees \
-D release="$(PACKAGE_VERSION)" \
$(top_srcdir)/doc doc/html
touch "$@"
docdot = \
doc_DATA = $(dochtml)
docpng = $(patsubst,%.png,$(docdot))
noinst_DATA = $(manhtml)
noinst_DATA = $(manhtml) doc/html
dist_sbin_SCRIPTS = \
daemons/ganeti-noded \
......@@ -149,8 +161,10 @@ EXTRA_DIST = \
autotools/docbook-wrapper \
devel/ \
$(docrst) \
$(docdot) \
$(docrst) \
doc/ \
doc/html \
doc/examples/ \
doc/examples/ \
doc/examples/ \
......@@ -234,16 +248,10 @@ doc/examples/%: doc/examples/ stamp-directories \
sed -f $(REPLACE_VARS_SED) < $< > $@
doc/%.html: doc/%.rst
@test -n "$(RST2HTML)" || { echo 'rst2html' not found during configure; exit 1; }
$(RST2HTML) $< $@
doc/%.png: doc/
@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
$(DOT) -Tpng -o $@ $<
doc/design-2.0.html: doc/design-2.0.rst doc/arch-2.0.png
man/ man/ man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
@test -n "$(DOCBOOK2MAN)" || { echo 'docbook2html' not found during configure; exit 1; }
TMPDIR=`mktemp -d` && { \
......@@ -138,12 +138,12 @@ then
AC_MSG_WARN([docbook2html not found, man pages rebuild will not be possible])
# Check for rst programs
AC_ARG_VAR(RST2HTML, [rst2html path])
AC_PATH_PROG(RST2HTML, [rst2html], [])
if test -z "$RST2HTML"
# Check for python-sphinx
AC_ARG_VAR(SPHINX, [sphinx-build path])
AC_PATH_PROG(SPHINX, [sphinx-build], [])
if test -z "$SPHINX"
AC_MSG_WARN([rst2html not found, documentation rebuild will not be possible])
AC_MSG_WARN([sphinx-build not found, documentation rebuild will not be possible])
# Check for graphviz (dot)
# -*- coding: utf-8 -*-
# Ganeti documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 14 13:23:20 2009.
# This file is execfile()d with the current directory set to its containing dir.
# Note that not all possible configuration values are present in this
# autogenerated file.
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# -- General configuration -----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.todo']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
source_encoding = 'utf-8'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Ganeti'
copyright = u'2006, 2007, 2008, 2009, Google Inc.'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
# These next two will be passed via the command line, see the makefile
# The short X.Y version
# The full version, including alpha/beta/rc tags.
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = 'en'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of documents that shouldn't be included in the build.
#unused_docs = []
# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_trees = ['_build', 'examples', 'api']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
html_use_modindex = False
# If false, no index is generated.
html_use_index = False
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = ''
# Output file base name for HTML help builder.
htmlhelp_basename = 'Ganetidoc'
# -- Options for LaTeX output --------------------------------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Ganeti.tex', u'Ganeti Documentation',
u'Google Inc.', 'manual'),
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
latex_use_modindex = False
.. Ganeti documentation master file,
created by sphinx-quickstart
Welcome to Ganeti's documentation!
.. toctree::
:maxdepth: 2
Also see the :ref:`search`.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment