Hwaro::Content::Processors::RenderHooks::HookRenderContext
Inherits Reference / Object
Renders one hook template against a small page/config variable set
plus per-element vars (destination/text/alt/level/...). Mirrors
ShortcodeProcessor#render_shortcode_jinja: compiled templates are
cached by source.hash ^ salt (a hook-specific salt keeps entries
from colliding with the page-template/shortcode caches that can
share the same underlying Hash), worker-local when @cache_mutex
is nil, mutex-guarded otherwise. A Crinja::TemplateError during
compile or render warns once per hook per build and falls back to
hand-written markup matching Markd's stock output shape.
Constants
Distinct per-hook salts — arbitrary, just pairwise distinct and unlikely to collide with the shortcode cache's own salt.
Constructors
Instance methods
Same idea for > [!NOTE]-style blockquotes: with [markdown] admonitions = true they keep rendering the stock shape so
postprocess_admonitions can rewrite them, instead of going
through the blockquote hook.
Config-decided bypass: a mermaid fence renders through the
existing mermaid pipeline (postprocess_mermaid) instead of the
codeblock hook when [markdown] mermaid = true.
Exposed so cache-key builders (e.g. render_body_cached) can
fold hook-template changes into their memo key without holding
a Registry reference of their own.
text is the captured, already-rendered inner HTML of the
blockquote (block-level: paragraphs, lists, nested quotes...).
lang/options/code arrive already escaped; highlighted is
the pre-highlighted (server mode) body HTML, or "" when
highlighting didn't apply — templates choose between
{{ highlighted }} and {{ code }}. name is the parsed
{name=...}/{title=...} label ("" when absent) so templates
don't have to re-parse options. copy is "true" when the
copy button applies to this block ("" otherwise) — templates
decide what markup, if any, to emit for it.
id is the already-deduped heading id (custom {#id} or a
generated slug — see HeadingIds.assign); text is the
captured inner HTML with any <!--HID:...--> marker removed.
alt is the captured plain text of the image's children (Markd's
@disable_tag protocol still applies — see HookedRenderer#image).
destination/title arrive already escaped by the caller
(HookedRenderer#link); text is the captured, already-rendered
inner HTML of the link.
html is the complete stock <table>...</table> markup;
header_html/body_html are its <thead>/<tbody> sections
(body_html is "" for a header-only table) so templates can
rebuild the table without re-parsing html. Blank lines are
collapsed out of the result: table hooks run in the pre-markd
line stream (TableParser), where markd ends an HTML block at
the first blank line — a blank line in the hook output would
split the table markup into a truncated HTML block plus
escaped-text leftovers.