diff options
author | itchyny <itchyny@cybozu.co.jp> | 2023-07-14 00:06:53 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-14 00:06:53 +0900 |
commit | 481167c8f186d534b2cef0e8a7d6a4d6dbc45d6b (patch) | |
tree | bdeb0303d4faf76ddd760f6e87410fecdc6a11fa | |
parent | 689a4e660b34bc687e6df05a79308d00e9c4f9cb (diff) |
Update jinja2 to fix deprecation warnings on building website (#2711)
-rw-r--r-- | docs/Pipfile | 2 | ||||
-rw-r--r-- | docs/Pipfile.lock | 8 | ||||
-rwxr-xr-x | docs/build_website.py | 5 |
3 files changed, 8 insertions, 7 deletions
diff --git a/docs/Pipfile b/docs/Pipfile index 38ac426c..d13d70cf 100644 --- a/docs/Pipfile +++ b/docs/Pipfile @@ -6,7 +6,7 @@ verify_ssl = true [dev-packages] [packages] -jinja2 = "==3.0.2" # FIXME: stop using deprecated features +jinja2 = "*" pyyaml = "*" markdown = "*" lxml = "*" diff --git a/docs/Pipfile.lock b/docs/Pipfile.lock index 53f44e84..02c664e5 100644 --- a/docs/Pipfile.lock +++ b/docs/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "3446f193e08e6a3c8f1d88af308dd7f8a668cccc270bc8374a4e95527f415a35" + "sha256": "16a9ef323592a417142c30be17e58c3cf36dc2bfdbf4757106a796b22262a1ce" }, "pipfile-spec": 6, "requires": {}, @@ -16,11 +16,11 @@ "default": { "jinja2": { "hashes": [ - "sha256:827a0e32839ab1600d4eb1c4c33ec5a8edfbc5cb42dafa13b81f182f97784b45", - "sha256:8569982d3f0889eed11dd620c706d39b60c36d6d25843961f33f77fb6bc6b20c" + "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852", + "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61" ], "index": "pypi", - "version": "==3.0.2" + "version": "==3.1.2" }, "lxml": { "hashes": [ diff --git a/docs/build_website.py b/docs/build_website.py index 75e6b8e6..5867f8c0 100755 --- a/docs/build_website.py +++ b/docs/build_website.py @@ -1,8 +1,9 @@ #!/usr/bin/env python3 import glob import itertools -from jinja2 import Environment, FileSystemLoader, Markup, select_autoescape, contextfunction +from jinja2 import Environment, FileSystemLoader, select_autoescape, pass_context from markdown import markdown +from markupsafe import Markup import os import os.path import re @@ -26,7 +27,7 @@ env.filters['entry_id'] = lambda input: re.sub(r"[ `]", '', input) env.filters['markdownify'] = lambda input: Markup(markdown(input)) env.filters['no_paragraph'] = lambda input: Markup(re.sub(r"</?p>", '', input)) -env.globals['unique_id'] = contextfunction( +env.globals['unique_id'] = pass_context( lambda ctx: str(next(ctx['unique_ctr']))) env.globals.update(load_yml_file('site.yml')) |