[Lxml-checkins] r54302 - in lxml/branch/lxml-2.0: . doc

scoder at codespeak.net scoder at codespeak.net
Thu May 1 12:01:36 CEST 2008


Author: scoder
Date: Thu May  1 12:01:35 2008
New Revision: 54302

Added:
   lxml/branch/lxml-2.0/doc/docstructure.py
      - copied unchanged from r53866, lxml/trunk/doc/docstructure.py
Modified:
   lxml/branch/lxml-2.0/Makefile
   lxml/branch/lxml-2.0/doc/main.txt
   lxml/branch/lxml-2.0/doc/mkhtml.py
Log:
PDF doc fixes from trunk

Modified: lxml/branch/lxml-2.0/Makefile
==============================================================================
--- lxml/branch/lxml-2.0/Makefile	(original)
+++ lxml/branch/lxml-2.0/Makefile	Thu May  1 12:01:35 2008
@@ -2,6 +2,7 @@
 TESTFLAGS=-p -v
 TESTOPTS=
 SETUPFLAGS=
+LXMLVERSION=`cat version.txt`
 
 all: inplace
 
@@ -40,17 +41,40 @@
 ftest_inplace: inplace
 	$(PYTHON) test.py -f $(TESTFLAGS) $(TESTOPTS)
 
-html: inplace
-	mkdir -p doc/html
-	PYTHONPATH=src $(PYTHON) doc/mkhtml.py doc/html . `cat version.txt`
+apihtml: inplace
 	rm -fr doc/html/api
 	@[ -x "`which epydoc`" ] \
 		&& (cd src && echo "Generating API docs ..." && \
 			PYTHONPATH=. epydoc -v --docformat "restructuredtext en" \
 			-o ../doc/html/api --no-private --exclude='[.]html[.]tests|[.]_' \
-			--name lxml --url http://codespeak.net/lxml/ lxml/) \
+			--exclude-introspect='[.]usedoctest' \
+			--name "lxml API" --url http://codespeak.net/lxml/ lxml/) \
 		|| (echo "not generating epydoc API documentation")
 
+html: inplace apihtml
+	PYTHONPATH=src $(PYTHON) doc/mkhtml.py doc/html . ${LXMLVERSION}
+
+apipdf: inplace
+	rm -fr doc/pdf
+	mkdir -p doc/pdf
+	@[ -x "`which epydoc`" ] \
+		&& (cd src && echo "Generating API docs ..." && \
+			PYTHONPATH=. epydoc -v --latex --docformat "restructuredtext en" \
+			-o ../doc/pdf --no-private --exclude='([.]html)?[.]tests|[.]_' \
+			--exclude-introspect='html[.]clean|[.]usedoctest' \
+			--name "lxml API" --url http://codespeak.net/lxml/ lxml/) \
+		|| (echo "not generating epydoc API documentation")
+
+pdf: apipdf
+	$(PYTHON) doc/mklatex.py doc/pdf . ${LXMLVERSION}
+	(cd doc/pdf && pdflatex lxmldoc.tex \
+		    && pdflatex lxmldoc.tex \
+		    && pdflatex lxmldoc.tex)
+	@pdfopt doc/pdf/lxmldoc.pdf doc/pdf/lxmldoc-${LXMLVERSION}.pdf
+	@echo "PDF available as doc/pdf/lxmldoc-${LXMLVERSION}.pdf"
+
+# Two pdflatex runs are needed to build the correct Table of contents.
+
 test: test_inplace
 
 valtest: valgrind_test_inplace
@@ -65,7 +89,12 @@
 	find . \( -name '*.o' -o -name '*.so' -o -name '*.py[cod]' -o -name '*.dll' \) -exec rm -f {} \;
 	rm -rf build
 
-realclean: clean
+docclean:
+	rm -f doc/html/*.html
+	rm -fr doc/html/api
+	rm -fr doc/pdf
+
+realclean: clean docclean
 	find . -name '*.c' -exec rm -f {} \;
 	rm -f TAGS
 	$(PYTHON) setup.py clean -a

Modified: lxml/branch/lxml-2.0/doc/main.txt
==============================================================================
--- lxml/branch/lxml-2.0/doc/main.txt	(original)
+++ lxml/branch/lxml-2.0/doc/main.txt	Thu May  1 12:01:35 2008
@@ -47,6 +47,10 @@
 Documentation
 -------------
 
+The complete lxml documentation is available for download as `PDF
+documentation`_. The HTML documentation from this web site is part of
+the normal `source download <#download>`_.
+
 * ElementTree:
 
   * `ElementTree API`_
@@ -140,32 +144,37 @@
 The source distribution is signed with `this key`_.  Binary builds for
 MS Windows usually become available through PyPI a few days after a
 source release.  If you can't wait, consider trying a less recent
-version first.
-
-.. _`lxml at the Python Package Index`: http://pypi.python.org/pypi/lxml/
-.. _`this key`: pubkey.asc
+release version first.
 
 The latest version is `lxml 2.0.5`_, released 2008-04-13
 (`changes for 2.0.5`_).  `Older versions`_ are listed below.
 
-.. _`Older versions`: #old-versions
-
 Please take a look at the `installation instructions`_!
 
-.. _`installation instructions`: installation.html
+This complete web site (including the generated API documentation) is
+part of the source distribution, so if you want to download the
+documentation for offline use, take the source archive and copy the
+``doc/html`` directory out of the source tree.
 
 It's also possible to check out the latest development version of lxml
 from svn directly, using a command like this::
 
   svn co http://codespeak.net/svn/lxml/trunk lxml
 
-You can also `browse it through the web`_.  Please read `how to build lxml
-from source`_ first.  The `latest CHANGES`_ of the developer version are also
-accessible.  You can check there if a bug you found has been fixed or a
-feature you want has been implemented in the latest trunk version.
+You can also browse the `Subversion repository`_ through the web, or
+take a look at the `Subversion history`_.  Please read `how to build lxml
+from source`_ first.  The `latest CHANGES`_ of the developer version
+are also accessible.  You can check there if a bug you found has been
+fixed or a feature you want has been implemented in the latest trunk
+version.
 
-.. _`how to build lxml from source`: build.html
-.. _`browse it through the web`: http://codespeak.net/svn/lxml
+.. _`lxml at the Python Package Index`: http://pypi.python.org/pypi/lxml/
+.. _`this key`: pubkey.asc
+.. _`Older versions`: #old-versions
+.. _`installation instructions`: installation.html
+ .. _`how to build lxml from source`: build.html
+.. _`Subversion repository`: http://codespeak.net/svn/lxml/
+.. _`Subversion history`: https://codespeak.net/viewvc/lxml/
 .. _`latest CHANGES`: http://codespeak.net/svn/lxml/trunk/CHANGES.txt
 
 
@@ -178,7 +187,7 @@
 
 .. _`mailing list`: http://codespeak.net/mailman/listinfo/lxml-dev
 .. _Gmane: http://blog.gmane.org/gmane.comp.python.lxml.devel
-.. _Google: http://www.google.com/webhp?q=site:codespeak.net/mailman/listinfo/lxml-dev%20
+.. _Google: http://www.google.com/webhp?q=site:codespeak.net%2Fmailman%2Flistinfo%2Flxml-dev+
 
 
 Bug tracker
@@ -189,7 +198,7 @@
 unexpected behaviour of lxml is a bug or not, please ask on the `mailing
 list`_ first.  Do not forget to search the archive (e.g. with Gmane_)!
 
-.. _`launchpad bug tracker`: https://launchpad.net/lxml
+.. _`launchpad bug tracker`: https://launchpad.net/lxml/
 
 
 License

Modified: lxml/branch/lxml-2.0/doc/mkhtml.py
==============================================================================
--- lxml/branch/lxml-2.0/doc/mkhtml.py	(original)
+++ lxml/branch/lxml-2.0/doc/mkhtml.py	Thu May  1 12:01:35 2008
@@ -1,21 +1,8 @@
+from docstructure import SITE_STRUCTURE, HREF_MAP, BASENAME_MAP
 from lxml.etree import (parse, fromstring, ElementTree,
                         Element, SubElement, XPath)
 import os, shutil, re, sys, copy, time
 
-SITE_STRUCTURE = [
-    ('lxml', ('main.txt', 'intro.txt', '../INSTALL.txt', 'lxml2.txt',
-              'performance.txt', 'compatibility.txt', 'FAQ.txt')),
-    ('Developing with lxml', ('tutorial.txt', '@API reference',
-                              'api.txt', 'parsing.txt',
-                              'validation.txt', 'xpathxslt.txt',
-                              'objectify.txt', 'lxmlhtml.txt',
-                              'cssselect.txt', 'elementsoup.txt')),
-    ('Extending lxml', ('resolvers.txt', 'extensions.txt',
-                        'element_classes.txt', 'sax.txt', 'capi.txt')),
-    ('Developing lxml', ('build.txt', 'lxml-source-howto.txt',
-                         '@Release Changelog')),
-    ]
-
 RST2HTML_OPTIONS = " ".join([
     "--no-toc-backlinks",
     "--strip-comments",
@@ -23,15 +10,6 @@
     "--date",
     ])
 
-HREF_MAP = {
-    "API reference" : "api/index.html"
-}
-
-BASENAME_MAP = {
-    'main' : 'index',
-    'INSTALL' : 'installation',
-}
-
 htmlnsmap = {"h" : "http://www.w3.org/1999/xhtml"}
 
 find_title = XPath("/h:html/h:head/h:title/text()", namespaces=htmlnsmap)


More information about the lxml-checkins mailing list