Merge lp:~jml/launchpad/sphinx-it-up into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Merged at revision: 12333
Proposed branch: lp:~jml/launchpad/sphinx-it-up
Merge into: lp:launchpad
Diff against target: 441 lines (+382/-5)
6 files modified
.bzrignore (+1/-0)
Makefile (+5/-1)
doc/Makefile (+130/-0)
doc/conf.py (+220/-0)
doc/index.txt (+24/-0)
doc/security.txt (+2/-4)
To merge this branch: bzr merge lp:~jml/launchpad/sphinx-it-up
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+48502@code.launchpad.net

Commit message

[r=allenap][no-qa] Machinery for building documentation with sphinx

Description of the change

This branch does very little that required thought from me. It just adds mechanisms for building documentation with Sphinx. Most of the added files were generated automatically by sphinx-quickstart.

Things that future branches might address:
 * more Launchpad-driven styling
 * reStructuredText mark-up fixes
 * expand the documentation
 * better information architecture so other docs in our tree are discoverable

The idea is to have these docs generated regularly and put on the web. Any docs that are useless when published in this way should be executed for the common good.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

I have python-sphinx installed (Maverick) and I get the following:

$ make doc
make -C doc/ html
make[1]: Entering directory `/home/gavin/Launchpad/launchpad/jml--sphinx-it-up/doc'
sphinx-build -b html -d _build/doctrees . _build/html
Running Sphinx v0.6.6

Extension error:
Could not import extension sphinx.ext.viewcode (exception: No module named viewcode)
make[1]: *** [html] Error 1
make[1]: Leaving directory `/home/gavin/Launchpad/launchpad/jml--sphinx-it-up/doc'
make: *** [doc] Error 2

Revision history for this message
Gavin Panella (allenap) wrote :

I'm able to keep going with a virtualenv:

{{{
virtualenv --no-site-packages run
run/bin/pip install sphinx
make SPHINXBUILD="$PWD/run/bin/sphinx-build" doc
}}}

Revision history for this message
Gavin Panella (allenap) wrote :

Cool :)

ISTR that BjornT did something similar once. I don't know what
happened to that though.

Needs Fixing because of the Sphinx dependency problem.

[1]

$ bzr stat
...
unknown:
  doc/_build/doctrees/
  doc/_build/html/

I think it's probably worth adding doc/_build to .bzrignore.

[2]

The output ends up in doc/_build/html. Is that intended? It seems an
odd place to put it, but I don't have any objections beyond that.

review: Needs Fixing
Revision history for this message
Gavin Panella (allenap) wrote :

Bootiful :)

As discussed, security.txt had a "severe" error:

/.../doc/security.txt:13: (SEVERE/4) Missing matching underline for section title overline.

This can be fixed with http://paste.ubuntu.com/562626/.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2011-02-03 00:46:28 +0000
3+++ .bzrignore 2011-02-04 17:30:32 +0000
4@@ -76,4 +76,5 @@
5 librarian.log
6 configs/testrunner_*
7 configs/testrunner-appserver_*
8+doc/_build
9 .idea
10
11=== modified file 'Makefile'
12--- Makefile 2011-01-19 17:05:03 +0000
13+++ Makefile 2011-02-04 17:30:32 +0000
14@@ -71,6 +71,10 @@
15
16 apidoc: compile $(API_INDEX)
17
18+# Used to generate HTML developer documentation for Launchpad.
19+doc:
20+ $(MAKE) -C doc/ html
21+
22 # Run by PQM.
23 check_merge: $(BUILDOUT_BIN)
24 [ `PYTHONPATH= bzr status -S database/schema/ | \
25@@ -485,7 +489,7 @@
26 --docformat restructuredtext --verbose-about epytext-summary \
27 $(PYDOCTOR_OPTIONS)
28
29-.PHONY: apidoc buildout_bin check tags TAGS zcmldocs realclean clean debug \
30+.PHONY: apidoc buildout_bin check doc tags TAGS zcmldocs realclean clean debug \
31 stop start run ftest_build ftest_inplace test_build test_inplace \
32 pagetests check check_merge schema default launchpad.pot \
33 check_merge_ui pull scan sync_branches reload-apache hosted_branches \
34
35=== added file 'doc/Makefile'
36--- doc/Makefile 1970-01-01 00:00:00 +0000
37+++ doc/Makefile 2011-02-04 17:30:32 +0000
38@@ -0,0 +1,130 @@
39+# Makefile for Sphinx documentation
40+#
41+
42+# You can set these variables from the command line.
43+SPHINXOPTS =
44+SPHINXBUILD = sphinx-build
45+PAPER =
46+BUILDDIR = _build
47+
48+# Internal variables.
49+PAPEROPT_a4 = -D latex_paper_size=a4
50+PAPEROPT_letter = -D latex_paper_size=letter
51+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
52+
53+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
54+
55+help:
56+ @echo "Please use \`make <target>' where <target> is one of"
57+ @echo " html to make standalone HTML files"
58+ @echo " dirhtml to make HTML files named index.html in directories"
59+ @echo " singlehtml to make a single large HTML file"
60+ @echo " pickle to make pickle files"
61+ @echo " json to make JSON files"
62+ @echo " htmlhelp to make HTML files and a HTML help project"
63+ @echo " qthelp to make HTML files and a qthelp project"
64+ @echo " devhelp to make HTML files and a Devhelp project"
65+ @echo " epub to make an epub"
66+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
67+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
68+ @echo " text to make text files"
69+ @echo " man to make manual pages"
70+ @echo " changes to make an overview of all changed/added/deprecated items"
71+ @echo " linkcheck to check all external links for integrity"
72+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
73+
74+clean:
75+ -rm -rf $(BUILDDIR)/*
76+
77+html:
78+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
79+ @echo
80+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
81+
82+dirhtml:
83+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
84+ @echo
85+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
86+
87+singlehtml:
88+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
89+ @echo
90+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
91+
92+pickle:
93+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
94+ @echo
95+ @echo "Build finished; now you can process the pickle files."
96+
97+json:
98+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
99+ @echo
100+ @echo "Build finished; now you can process the JSON files."
101+
102+htmlhelp:
103+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
104+ @echo
105+ @echo "Build finished; now you can run HTML Help Workshop with the" \
106+ ".hhp project file in $(BUILDDIR)/htmlhelp."
107+
108+qthelp:
109+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
110+ @echo
111+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
112+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
113+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Launchpad.qhcp"
114+ @echo "To view the help file:"
115+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Launchpad.qhc"
116+
117+devhelp:
118+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
119+ @echo
120+ @echo "Build finished."
121+ @echo "To view the help file:"
122+ @echo "# mkdir -p $$HOME/.local/share/devhelp/Launchpad"
123+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Launchpad"
124+ @echo "# devhelp"
125+
126+epub:
127+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
128+ @echo
129+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
130+
131+latex:
132+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
133+ @echo
134+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
135+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
136+ "(use \`make latexpdf' here to do that automatically)."
137+
138+latexpdf:
139+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
140+ @echo "Running LaTeX files through pdflatex..."
141+ make -C $(BUILDDIR)/latex all-pdf
142+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
143+
144+text:
145+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
146+ @echo
147+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
148+
149+man:
150+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
151+ @echo
152+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
153+
154+changes:
155+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
156+ @echo
157+ @echo "The overview file is in $(BUILDDIR)/changes."
158+
159+linkcheck:
160+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
161+ @echo
162+ @echo "Link check complete; look for any errors in the above output " \
163+ "or in $(BUILDDIR)/linkcheck/output.txt."
164+
165+doctest:
166+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
167+ @echo "Testing of doctests in the sources finished, look at the " \
168+ "results in $(BUILDDIR)/doctest/output.txt."
169
170=== added directory 'doc/_static'
171=== added directory 'doc/_templates'
172=== added file 'doc/conf.py'
173--- doc/conf.py 1970-01-01 00:00:00 +0000
174+++ doc/conf.py 2011-02-04 17:30:32 +0000
175@@ -0,0 +1,220 @@
176+# -*- coding: utf-8 -*-
177+#
178+# Launchpad documentation build configuration file, created by
179+# sphinx-quickstart on Thu Feb 3 16:06:09 2011.
180+#
181+# This file is execfile()d with the current directory set to its containing dir.
182+#
183+# Note that not all possible configuration values are present in this
184+# autogenerated file.
185+#
186+# All configuration values have a default; values that are commented out
187+# serve to show the default.
188+
189+import sys, os
190+
191+# If extensions (or modules to document with autodoc) are in another directory,
192+# add these directories to sys.path here. If the directory is relative to the
193+# documentation root, use os.path.abspath to make it absolute, like shown here.
194+#sys.path.insert(0, os.path.abspath('.'))
195+
196+# -- General configuration -----------------------------------------------------
197+
198+# If your documentation needs a minimal Sphinx version, state it here.
199+#needs_sphinx = '1.0'
200+
201+# Add any Sphinx extension module names here, as strings. They can be extensions
202+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
203+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo']
204+
205+# Add any paths that contain templates here, relative to this directory.
206+templates_path = ['_templates']
207+
208+# The suffix of source filenames.
209+source_suffix = '.txt'
210+
211+# The encoding of source files.
212+#source_encoding = 'utf-8-sig'
213+
214+# The master toctree document.
215+master_doc = 'index'
216+
217+# General information about the project.
218+project = u'Launchpad'
219+copyright = u'2011, The Launchpad Developers'
220+
221+# The version info for the project you're documenting, acts as replacement for
222+# |version| and |release|, also used in various other places throughout the
223+# built documents.
224+#
225+# The short X.Y version.
226+version = 'dev'
227+# The full version, including alpha/beta/rc tags.
228+release = 'dev'
229+
230+# The language for content autogenerated by Sphinx. Refer to documentation
231+# for a list of supported languages.
232+#language = None
233+
234+# There are two options for replacing |today|: either, you set today to some
235+# non-false value, then it is used:
236+#today = ''
237+# Else, today_fmt is used as the format for a strftime call.
238+#today_fmt = '%B %d, %Y'
239+
240+# List of patterns, relative to source directory, that match files and
241+# directories to ignore when looking for source files.
242+exclude_patterns = ['_build']
243+
244+# The reST default role (used for this markup: `text`) to use for all documents.
245+#default_role = None
246+
247+# If true, '()' will be appended to :func: etc. cross-reference text.
248+#add_function_parentheses = True
249+
250+# If true, the current module name will be prepended to all description
251+# unit titles (such as .. function::).
252+#add_module_names = True
253+
254+# If true, sectionauthor and moduleauthor directives will be shown in the
255+# output. They are ignored by default.
256+#show_authors = False
257+
258+# The name of the Pygments (syntax highlighting) style to use.
259+pygments_style = 'sphinx'
260+
261+# A list of ignored prefixes for module index sorting.
262+#modindex_common_prefix = []
263+
264+
265+# -- Options for HTML output ---------------------------------------------------
266+
267+# The theme to use for HTML and HTML Help pages. See the documentation for
268+# a list of builtin themes.
269+html_theme = 'default'
270+
271+# Theme options are theme-specific and customize the look and feel of a theme
272+# further. For a list of options available for each theme, see the
273+# documentation.
274+#html_theme_options = {}
275+
276+# Add any paths that contain custom themes here, relative to this directory.
277+#html_theme_path = []
278+
279+# The name for this set of Sphinx documents. If None, it defaults to
280+# "<project> v<release> documentation".
281+#html_title = None
282+
283+# A shorter title for the navigation bar. Default is the same as html_title.
284+#html_short_title = None
285+
286+# The name of an image file (relative to this directory) to place at the top
287+# of the sidebar.
288+#html_logo = None
289+
290+# The name of an image file (within the static path) to use as favicon of the
291+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
292+# pixels large.
293+#html_favicon = None
294+
295+# Add any paths that contain custom static files (such as style sheets) here,
296+# relative to this directory. They are copied after the builtin static files,
297+# so a file named "default.css" will overwrite the builtin "default.css".
298+html_static_path = ['_static']
299+
300+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
301+# using the given strftime format.
302+#html_last_updated_fmt = '%b %d, %Y'
303+
304+# If true, SmartyPants will be used to convert quotes and dashes to
305+# typographically correct entities.
306+#html_use_smartypants = True
307+
308+# Custom sidebar templates, maps document names to template names.
309+#html_sidebars = {}
310+
311+# Additional templates that should be rendered to pages, maps page names to
312+# template names.
313+#html_additional_pages = {}
314+
315+# If false, no module index is generated.
316+#html_domain_indices = True
317+
318+# If false, no index is generated.
319+#html_use_index = True
320+
321+# If true, the index is split into individual pages for each letter.
322+#html_split_index = False
323+
324+# If true, links to the reST sources are added to the pages.
325+#html_show_sourcelink = True
326+
327+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
328+#html_show_sphinx = True
329+
330+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
331+#html_show_copyright = True
332+
333+# If true, an OpenSearch description file will be output, and all pages will
334+# contain a <link> tag referring to it. The value of this option must be the
335+# base URL from which the finished HTML is served.
336+#html_use_opensearch = ''
337+
338+# This is the file name suffix for HTML files (e.g. ".xhtml").
339+#html_file_suffix = None
340+
341+# Output file base name for HTML help builder.
342+htmlhelp_basename = 'Launchpaddoc'
343+
344+
345+# -- Options for LaTeX output --------------------------------------------------
346+
347+# The paper size ('letter' or 'a4').
348+#latex_paper_size = 'letter'
349+
350+# The font size ('10pt', '11pt' or '12pt').
351+#latex_font_size = '10pt'
352+
353+# Grouping the document tree into LaTeX files. List of tuples
354+# (source start file, target name, title, author, documentclass [howto/manual]).
355+latex_documents = [
356+ ('index', 'Launchpad.tex', u'Launchpad Documentation',
357+ u'The Launchpad Developers', 'manual'),
358+]
359+
360+# The name of an image file (relative to this directory) to place at the top of
361+# the title page.
362+#latex_logo = None
363+
364+# For "manual" documents, if this is true, then toplevel headings are parts,
365+# not chapters.
366+#latex_use_parts = False
367+
368+# If true, show page references after internal links.
369+#latex_show_pagerefs = False
370+
371+# If true, show URL addresses after external links.
372+#latex_show_urls = False
373+
374+# Additional stuff for the LaTeX preamble.
375+#latex_preamble = ''
376+
377+# Documents to append as an appendix to all manuals.
378+#latex_appendices = []
379+
380+# If false, no module index is generated.
381+#latex_domain_indices = True
382+
383+
384+# -- Options for manual page output --------------------------------------------
385+
386+# One entry per manual page. List of tuples
387+# (source start file, name, description, authors, manual section).
388+man_pages = [
389+ ('index', 'launchpad', u'Launchpad Documentation',
390+ [u'The Launchpad Developers'], 1)
391+]
392+
393+
394+# Example configuration for intersphinx: refer to the Python standard library.
395+intersphinx_mapping = {'http://docs.python.org/': None}
396
397=== added file 'doc/index.txt'
398--- doc/index.txt 1970-01-01 00:00:00 +0000
399+++ doc/index.txt 2011-02-04 17:30:32 +0000
400@@ -0,0 +1,24 @@
401+.. Launchpad documentation master file, created by
402+ sphinx-quickstart on Tue Aug 10 16:12:45 2010.
403+ You can adapt this file completely to your liking, but it should at least
404+ contain the root `toctree` directive.
405+
406+Launchpad developer documentation
407+=================================
408+
409+Contents:
410+
411+.. toctree::
412+ :maxdepth: 1
413+
414+ README <readme>
415+ Launchpad Vision <vision>
416+ Launchpad Values <values>
417+
418+
419+Indices and tables
420+==================
421+
422+* :ref:`genindex`
423+* :ref:`modindex`
424+* :ref:`search`
425
426=== modified file 'doc/security.txt'
427--- doc/security.txt 2010-12-21 17:52:32 +0000
428+++ doc/security.txt 2011-02-04 17:30:32 +0000
429@@ -10,10 +10,8 @@
430 Defining Permissions in Launchpad
431 ---------------------------------
432
433-**************************************************************************
434-NOTE: A new permission should only be defined if absolutely necessary, and
435-it should be considered thoroughly in a code review.
436-**************************************************************************
437+**NOTE: A new permission should only be defined if absolutely necessary, and
438+it should be considered thoroughly in a code review.**
439
440 Occassionally, you'll find yourself in a situation where the existing
441 permissions in Launchpad aren't enough for what you want. For example, as I