diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-02-04 17:06:53 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-02-04 20:17:49 +0900 |
commit | 976fc326b9f91e9d16bb29a76b9daf07c6afc92e (patch) | |
tree | a9ad9d943a2c10e81b10fe2702d518689624b23a /sphinx/util/template.py | |
parent | 7edcec66c9f79c9ba47e54a3e1a381b4e2599327 (diff) | |
download | sphinx-git-976fc326b9f91e9d16bb29a76b9daf07c6afc92e.tar.gz |
latex: Use templates to render tables
Diffstat (limited to 'sphinx/util/template.py')
-rw-r--r-- | sphinx/util/template.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sphinx/util/template.py b/sphinx/util/template.py index 01d365994..f6db8034b 100644 --- a/sphinx/util/template.py +++ b/sphinx/util/template.py @@ -43,8 +43,10 @@ class FileRenderer(BaseRenderer): class SphinxRenderer(FileRenderer): - def __init__(self): - super(SphinxRenderer, self).__init__(os.path.join(package_dir, 'templates')) + def __init__(self, template_path=None): + if template_path is None: + template_path = os.path.join(package_dir, 'templates') + super(SphinxRenderer, self).__init__(template_path) @classmethod def render_from_file(cls, filename, context): @@ -53,7 +55,8 @@ class SphinxRenderer(FileRenderer): class LaTeXRenderer(SphinxRenderer): def __init__(self): - super(LaTeXRenderer, self).__init__() + template_path = os.path.join(package_dir, 'templates', 'latex') + super(LaTeXRenderer, self).__init__(template_path) # use JSP/eRuby like tagging instead because curly bracket; the default # tagging of jinja2 is not good for LaTeX sources. |