Barry Warsaw  committed 3bb949b

Add -c option to 'python build_sphinx' to specify the config
directory different than the source directory.

  • Participants
  • Parent commits d2ce667

Comments (0)

Files changed (1)

File sphinx/

         ('all-files', 'a', 'build all files'),
         ('source-dir=', 's', 'Source directory'),
         ('build-dir=', None, 'Build directory'),
+        ('config-dir=', 'c', 'Location of the configuration directory'),
         ('builder=', 'b', 'The builder to use. Defaults to "html"'),
         ('project=', None, 'The documented project\'s name'),
         ('version=', None, 'The short X.Y version'),
         self.version = ''
         self.release = '' = ''
+        self.config_dir = None
     def _guess_source_dir(self):
         for guess in ('doc', 'docs'):
             self.announce('Using source directory %s' % self.source_dir)
         self.source_dir = os.path.abspath(self.source_dir)
+        if self.config_dir is None:
+            self.config_dir = self.source_dir
         if self.build_dir is None:
             build = self.get_finalized_command('build')
              confoverrides['release'] = self.release
              confoverrides['today'] =
-        app = Sphinx(self.source_dir, self.source_dir,
+        app = Sphinx(self.source_dir, self.config_dir,
                      self.builder_target_dir, self.doctree_dir,
                      self.builder, confoverrides, status_stream,