summaryrefslogtreecommitdiff
path: root/sphinx/util/template.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2017-02-04 17:06:53 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2017-02-04 20:17:49 +0900
commit976fc326b9f91e9d16bb29a76b9daf07c6afc92e (patch)
treea9ad9d943a2c10e81b10fe2702d518689624b23a /sphinx/util/template.py
parent7edcec66c9f79c9ba47e54a3e1a381b4e2599327 (diff)
downloadsphinx-git-976fc326b9f91e9d16bb29a76b9daf07c6afc92e.tar.gz
latex: Use templates to render tables
Diffstat (limited to 'sphinx/util/template.py')
-rw-r--r--sphinx/util/template.py9
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.