Implemented rst_prologue conf.py option.

This commit is contained in:
tpowers 2010-03-30 05:13:42 -07:00
parent ff3707e2a5
commit 68fd75f536
2 changed files with 5 additions and 3 deletions

View File

@ -59,6 +59,7 @@ class Config(object):
keep_warnings = (False, 'env'),
modindex_common_prefix = ([], 'html'),
rst_epilog = (None, 'env'),
rst_prologue = (None, 'env'),
trim_doctest_flags = (True, 'env'),
needs_sphinx = (None, None),
secnumber_suffix = ('. ', 'html'),

View File

@ -589,9 +589,10 @@ class BuildEnvironment:
app.emit('source-read', docname, arg)
data = arg[0]
if self.config.rst_epilog:
return data + '\n' + self.config.rst_epilog + '\n'
else:
return data
data = data + '\n' + self.config.rst_epilog + '\n'
if self.config.rst_prologue:
data = self.config.rst_prologue + '\n' + data
return data
# publish manually
pub = Publisher(reader=SphinxStandaloneReader(),