Skip to content

Commit 481167c

Browse files
authored
Update jinja2 to fix deprecation warnings on building website (#2711)
1 parent 689a4e6 commit 481167c

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

docs/Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ verify_ssl = true
66
[dev-packages]
77

88
[packages]
9-
jinja2 = "==3.0.2" # FIXME: stop using deprecated features
9+
jinja2 = "*"
1010
pyyaml = "*"
1111
markdown = "*"
1212
lxml = "*"

docs/Pipfile.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/build_website.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env python3
22
import glob
33
import itertools
4-
from jinja2 import Environment, FileSystemLoader, Markup, select_autoescape, contextfunction
4+
from jinja2 import Environment, FileSystemLoader, select_autoescape, pass_context
55
from markdown import markdown
6+
from markupsafe import Markup
67
import os
78
import os.path
89
import re
@@ -26,7 +27,7 @@ def load_yml_file(fn):
2627
env.filters['markdownify'] = lambda input: Markup(markdown(input))
2728
env.filters['no_paragraph'] = lambda input: Markup(re.sub(r"</?p>", '', input))
2829

29-
env.globals['unique_id'] = contextfunction(
30+
env.globals['unique_id'] = pass_context(
3031
lambda ctx: str(next(ctx['unique_ctr'])))
3132

3233
env.globals.update(load_yml_file('site.yml'))

0 commit comments

Comments
 (0)