mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Template dirs are relative to the root.
This commit is contained in:
parent
6aae7cf9ff
commit
19df48d2cb
@ -80,7 +80,9 @@ class Builder(object):
|
|||||||
# load templates
|
# load templates
|
||||||
self.templates = {}
|
self.templates = {}
|
||||||
base_templates_path = path.join(path.dirname(__file__), '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,
|
self.jinja_env = Environment(loader=loader,
|
||||||
# disable traceback, more likely that something
|
# disable traceback, more likely that something
|
||||||
# in the application is broken than in the templates
|
# in the application is broken than in the templates
|
||||||
|
@ -278,9 +278,10 @@ document is a custom template, you can also set this to another filename.'''
|
|||||||
|
|
||||||
mkdir_p(srcdir)
|
mkdir_p(srcdir)
|
||||||
if separate:
|
if separate:
|
||||||
mkdir_p(path.join(d['path'], 'build'))
|
builddir = path.join(d['path'], 'build')
|
||||||
else:
|
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'] + 'templates'))
|
||||||
mkdir_p(path.join(srcdir, d['dot'] + 'static'))
|
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 bold('Finished: An initial directory structure has been created.')
|
||||||
print '''
|
print '''
|
||||||
You should now populate your master file %s and create other documentation
|
You should now populate your master file %s and create other documentation
|
||||||
source files. Use the sphinx-build.py script to build the docs.
|
source files. Use the sphinx-build.py script to build the docs, like so:
|
||||||
''' % (masterfile)
|
|
||||||
|
sphinx-build.py -b <builder> %s %s
|
||||||
|
''' % (masterfile, srcdir, builddir)
|
||||||
|
|
||||||
|
|
||||||
def main(argv=sys.argv):
|
def main(argv=sys.argv):
|
||||||
|
Loading…
Reference in New Issue
Block a user