From 19df48d2cb351d25bc2412996c3a2c56f2e237ba Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 12 Mar 2008 21:07:53 +0000 Subject: [PATCH] Template dirs are relative to the root. --- sphinx/builder.py | 4 +++- sphinx/quickstart.py | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sphinx/builder.py b/sphinx/builder.py index 504b5869d..1ba62e552 100644 --- a/sphinx/builder.py +++ b/sphinx/builder.py @@ -80,7 +80,9 @@ class Builder(object): # load templates self.templates = {} base_templates_path = path.join(path.dirname(__file__), 'templates') - loader = SphinxFileSystemLoader(base_templates_path, self.config.templates_path) + ext_templates_path = [path.join(self.srcdir, dir) + for dir in self.config.templates_path] + loader = SphinxFileSystemLoader(base_templates_path, ext_templates_path) self.jinja_env = Environment(loader=loader, # disable traceback, more likely that something # in the application is broken than in the templates diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index a1542e985..7e6da3f38 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -278,9 +278,10 @@ document is a custom template, you can also set this to another filename.''' mkdir_p(srcdir) if separate: - mkdir_p(path.join(d['path'], 'build')) + builddir = path.join(d['path'], 'build') else: - mkdir_p(path.join(srcdir, d['dot'] + 'build')) + builddir = path.join(srcdir, d['dot'] + 'build') + mkdir_p(builddir) mkdir_p(path.join(srcdir, d['dot'] + 'templates')) mkdir_p(path.join(srcdir, d['dot'] + 'static')) @@ -297,8 +298,10 @@ document is a custom template, you can also set this to another filename.''' print bold('Finished: An initial directory structure has been created.') print ''' You should now populate your master file %s and create other documentation -source files. Use the sphinx-build.py script to build the docs. -''' % (masterfile) +source files. Use the sphinx-build.py script to build the docs, like so: + + sphinx-build.py -b %s %s +''' % (masterfile, srcdir, builddir) def main(argv=sys.argv):