# HG changeset patch # User cmlenz # Date 1181720886 0 # Node ID a696e249467a7da56647cf5f08329f32d1ac4ccd # Parent a02952b73cf15814af6064c7cb2a2e2fc8e3d0d1 Add `--without-apidocs` switch to `build_doc` command for quicker doc-edit/review cycles. diff --git a/doc/formatting.txt b/doc/formatting.txt --- a/doc/formatting.txt +++ b/doc/formatting.txt @@ -14,10 +14,12 @@ =============== When working with date and time information in Python, you commonly use the -classes ``date``, ``datetime`` and/or ``time`` from the `datetime package`_. +classes ``date``, ``datetime`` and/or ``time`` from the `datetime`_ package. Babel provides functions for locale-specific formatting of those objects in its ``dates`` module: +.. _`datetime`: http://docs.python.org/lib/module-datetime.html + .. code-block:: pycon >>> from datetime import date, datetime, time @@ -51,8 +53,6 @@ >>> format_date(d, format='full', locale='en') u'Sunday, April 1, 2007' -.. _`datetime package`: http://docs.python.org/lib/module-datetime.html - Pattern Syntax -------------- diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -25,10 +25,14 @@ class build_doc(Command): description = 'Builds the documentation' - user_options = [] + user_options = [ + ('without-apidocs', None, + "whether to skip the generation of API documentaton"), + ] + boolean_options = ['without-apidocs'] def initialize_options(self): - pass + self.without_apidocs = False def finalize_options(self): pass @@ -67,20 +71,21 @@ argv=['--config=%s' % docutils_conf, source, dest]) - try: - from epydoc import cli - old_argv = sys.argv[1:] - sys.argv[1:] = [ - '--config=%s' % epydoc_conf, - '--no-private', # epydoc bug, not read from config - '--simple-term', - '--verbose' - ] - cli.cli() - sys.argv[1:] = old_argv + if not self.without_apidocs: + try: + from epydoc import cli + old_argv = sys.argv[1:] + sys.argv[1:] = [ + '--config=%s' % epydoc_conf, + '--no-private', # epydoc bug, not read from config + '--simple-term', + '--verbose' + ] + cli.cli() + sys.argv[1:] = old_argv - except ImportError: - print 'epydoc not installed, skipping API documentation.' + except ImportError: + print 'epydoc not installed, skipping API documentation.' class test_doc(Command):