Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion extensions/rapids_notebook_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
import tempfile
from functools import partial

import jinja2


def template_func(app, match):
return app.builder.templates.render_string(match.group(), app.config.rapids_version)
template = jinja2.Template(match.group())
return template.render(app.config.rapids_version)


def walk_files(app, dir, outdir):
Expand Down
6 changes: 3 additions & 3 deletions extensions/rapids_version_templating.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from copy import deepcopy
from typing import TYPE_CHECKING

import jinja2
from docutils import nodes

if TYPE_CHECKING:
Expand Down Expand Up @@ -73,9 +74,8 @@ def template_func(self, match: re.Match) -> str:
Replace template strings like ``{{ rapids_version }}`` with real
values like ``24.10``.
"""
return self.app.builder.templates.render_string(
source=match.group(), context=self.app.config.rapids_version
)
template = jinja2.Template(match.group())
return template.render(self.app.config.rapids_version)


def version_template(
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ dependencies = [
"sphinx-autobuild>=2024.9.19",
"sphinx-copybutton>=0.5.2",
"sphinx-design>=0.6.1",
"sphinx-llm>=0.1.4",
"sphinxcontrib-mermaid>=1.0.0",
"python-frontmatter>=1.1.0",
"sphinx-reredirects"
"sphinx-reredirects",
]

[tool.codespell]
Expand All @@ -43,7 +44,7 @@ select = [
# pyupgrade
"UP",
# flake8-bugbear
"B"
"B",
]

[tool.ruff.lint.per-file-ignores]
Expand Down
1 change: 1 addition & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"rapids_version_templating",
"rapids_admonitions",
"sphinx_reredirects",
"sphinx_llm.txt",
]

myst_enable_extensions = ["colon_fence", "dollarmath"]
Expand Down
29 changes: 29 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.