2023-09-12 18:29:50 +01:00
|
|
|
from mkdocs.plugins import event_priority
|
|
|
|
|
|
|
|
@event_priority(100)
|
2023-09-10 14:44:04 +01:00
|
|
|
def on_page_markdown(markdown, page, config, files):
|
|
|
|
# HACK: Calculate what the `env` should probably look like. By default, `on_env` is called after `on_page_markdown`.
|
|
|
|
env = config.plugins.on_env(config.theme.get_env(), config=config, files=files)
|
|
|
|
|
|
|
|
template = env.from_string(markdown)
|
|
|
|
|
|
|
|
return template.render(page=page)
|