-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Rename template files in Sphinx to use preferred .jinja suffix.
#12364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
4138994
0126b7a
7ce2e34
f2be104
2d2088c
3c374e5
ad9f5fa
12fda32
d071133
e6d3932
ac11e8e
7945968
1b6a100
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -437,7 +437,7 @@ def astext(self) -> str: | |
| 'body': ''.join(self.body), | ||
| 'indices': self.generate_indices(), | ||
| }) | ||
| return self.render('latex.tex_t', self.elements) | ||
| return self.render('latex.tex.jinja', self.elements) | ||
|
|
||
| def hypertarget(self, id: str, withdoc: bool = True, anchor: bool = True) -> str: | ||
| if withdoc: | ||
|
|
@@ -521,6 +521,10 @@ def render(self, template_name: str, variables: dict[str, Any]) -> str: | |
| template_name) | ||
| if path.exists(template): | ||
| return renderer.render(template, variables) | ||
| elif template_name.endswith('.jinja'): | ||
| legacy_template = template[:-len('.jinja')] + '_t' | ||
jayaddison marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if path.exists(legacy_template): | ||
| return renderer.render(legacy_template, variables) | ||
|
||
|
|
||
| return renderer.render(template_name, variables) | ||
|
|
||
|
|
@@ -1033,7 +1037,7 @@ def depart_table(self, node: Element) -> None: | |
| assert self.table is not None | ||
| labels = self.hypertarget_to(node) | ||
| table_type = self.table.get_table_type() | ||
| table = self.render(table_type + '.tex_t', | ||
| table = self.render(table_type + '.tex.jinja', | ||
| {'table': self.table, 'labels': labels}) | ||
| self.body.append(BLANKLINE) | ||
| self.body.append(table) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.