First pass at double header display

This commit is contained in:
Rapptz
2020-05-31 09:12:26 -04:00
parent 16740623a3
commit 33a4388e6e
5 changed files with 200 additions and 44 deletions

View File

@ -42,6 +42,12 @@ class DPYStandaloneHTMLBuilder(StandaloneHTMLBuilder):
else:
self.handle_page('genindex', genindexcontext, 'genindex.html')
def add_custom_jinja2(app):
env = app.builder.templates.environment
env.tests['prefixedwith'] = str.startswith
env.tests['suffixedwith'] = str.endswith
def get_builder(app):
"""This is necessary because RTD injects their own for some reason."""
try:
@ -56,3 +62,4 @@ def get_builder(app):
def setup(app):
app.set_translator('html', DPYHTML5Translator, override=True)
app.add_builder(get_builder(app), override=True)
app.connect('builder-inited', add_custom_jinja2)