]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Moved doc config into a subdirectory, and added a `--force` option to the `build_doc...
authorChristopher Lenz <cmlenz@gmail.com>
Fri, 15 Jun 2007 18:27:38 +0000 (18:27 +0000)
committerChristopher Lenz <cmlenz@gmail.com>
Fri, 15 Jun 2007 18:27:38 +0000 (18:27 +0000)
doc/conf/docutils.ini [moved from doc/docutils.conf with 100% similarity]
doc/conf/epydoc.ini [moved from doc/epydoc.conf with 100% similarity]
setup.py

similarity index 100%
rename from doc/docutils.conf
rename to doc/conf/docutils.ini
similarity index 100%
rename from doc/epydoc.conf
rename to doc/conf/epydoc.ini
index b27adc9f58cd841037ff94d70b3cfe616a31fdab..8efd523f7de90e633f5c4c526ecf575dd8a3ab63 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -26,12 +26,15 @@ import sys
 class build_doc(Command):
     description = 'Builds the documentation'
     user_options = [
+        ('force', None,
+         "force regeneration even if no reStructuredText files have changed"),
         ('without-apidocs', None,
          "whether to skip the generation of API documentaton"),
     ]
-    boolean_options = ['without-apidocs']
+    boolean_options = ['force', 'without-apidocs']
 
     def initialize_options(self):
+        self.force = False
         self.without_apidocs = False
 
     def finalize_options(self):
@@ -42,8 +45,8 @@ class build_doc(Command):
         from docutils.nodes import raw
         from docutils.parsers import rst
 
-        docutils_conf = os.path.join('doc', 'docutils.conf')
-        epydoc_conf = os.path.join('doc', 'epydoc.conf')
+        docutils_conf = os.path.join('doc', 'conf', 'docutils.ini')
+        epydoc_conf = os.path.join('doc', 'conf', 'epydoc.ini')
 
         try:
             from pygments import highlight
@@ -64,8 +67,8 @@ class build_doc(Command):
 
         for source in glob('doc/*.txt'):
             dest = os.path.splitext(source)[0] + '.html'
-            if not os.path.exists(dest) or \
-                   os.path.getmtime(dest) < os.path.getmtime(source):
+            if self.force or not os.path.exists(dest) or \
+                    os.path.getmtime(dest) < os.path.getmtime(source):
                 print 'building documentation file %s' % dest
                 publish_cmdline(writer_name='html',
                                 argv=['--config=%s' % docutils_conf, source,