summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJon Waltman <jonathan.waltman@gmail.com>2012-12-04 21:10:15 -0600
committerJon Waltman <jonathan.waltman@gmail.com>2012-12-04 21:10:15 -0600
commit4ba1b19953223c6b4ac0f4e82b6116ee5849ef47 (patch)
tree55c818ca911dda55edc61e0a49e7c2b060b0046c /doc
parent7adf543e001eaee607cce707512d851b02a885d8 (diff)
downloadsphinx-4ba1b19953223c6b4ac0f4e82b6116ee5849ef47.tar.gz
Add Docutils-native XML and pseudo-XML builders
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile13
-rw-r--r--doc/builders.rst23
-rw-r--r--doc/config.rst10
3 files changed, 45 insertions, 1 deletions
diff --git a/doc/Makefile b/doc/Makefile
index 47951316..a46b0227 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -13,7 +13,8 @@ ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) \
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(O) .
.PHONY: help clean html dirhtml singlehtml text man pickle json htmlhelp \
- qthelp devhelp epub latex latexpdf changes linkcheck doctest
+ qthelp devhelp epub latex latexpdf changes linkcheck doctest xml \
+ pseudoxml
help:
@echo "Please use \`make <target>' where <target> is one of"
@@ -147,3 +148,13 @@ info:
@echo "Running Texinfo files through makeinfo..."
make -C _build/texinfo info
@echo "makeinfo finished; the Info files are in _build/texinfo."
+
+xml:
+ $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) _build/xml
+ @echo
+ @echo "Build finished. The XML files are in _build/XML."
+
+pseudoxml:
+ $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) _build/pseudoxml
+ @echo
+ @echo "Build finished. The pseudo-XML files are in _build/pseudoxml."
diff --git a/doc/builders.rst b/doc/builders.rst
index 6600807d..0075ad81 100644
--- a/doc/builders.rst
+++ b/doc/builders.rst
@@ -272,6 +272,29 @@ Note that a direct PDF builder using ReportLab is available in `rst2pdf
Its name is ``linkcheck``.
+.. module:: sphinx.builders.xml
+.. class:: XMLBuilder
+
+ This builder produces Docutils-native XML files. The output can be
+ transformed with standard XML tools such as XSLT processors into arbitrary
+ final forms.
+
+ Its name is ``xml``.
+
+ .. versionadded:: 1.2
+
+.. class:: PseudoXMLBuilder
+
+ This builder is used for debugging the Sphinx/Docutils "Reader to Transform
+ to Writer" pipeline. It produces compact pretty-printed "pseudo-XML", files
+ where nesting is indicated by indentation (no end-tags). External
+ attributes for all elements are output, and internal attributes for any
+ leftover "pending" elements are also given.
+
+ Its name is ``pseudoxml``.
+
+ .. versionadded:: 1.2
+
Built-in Sphinx extensions that offer more builders are:
diff --git a/doc/config.rst b/doc/config.rst
index df5a208c..0ff6d405 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -1342,6 +1342,16 @@ Options for the linkcheck builder
.. versionadded:: 1.2
+Options for the XML builder
+---------------------------
+
+.. confval:: xml_pretty
+
+ If True, pretty-print the XML. Default is ``True``.
+
+ .. versionadded:: 1.2
+
+
.. rubric:: Footnotes
.. [1] A note on available globbing syntax: you can use the standard shell