From b6418b090fe7c515ba2fd2a63c41035cfd097fb5 Mon Sep 17 00:00:00 2001 From: randogoth Date: Thu, 22 Oct 2026 11:25:13 +0300 Subject: [PATCH 1/3] feat: smolnet rewrites `> [!kind]` callout markers With SMOLNET_CALLOUTS (kind -> label), the marker line becomes a bold label and the passage stays a blockquote, instead of the literal "[!ontology]" printing in the capsule. Unlisted kinds are left alone. Default {} keeps other sites unchanged. Co-Authored-By: Claude Opus 5.5 --- plugins/smolnet.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/plugins/smolnet.py b/plugins/smolnet.py index 0937e23..c571521 100644 --- a/plugins/smolnet.py +++ b/plugins/smolnet.py @@ -31,6 +31,8 @@ setting, and every setting has a default, so a site can switch it on with just Notes section; off by default since not every site using this plugin has been checked for footnotes + SMOLNET_CALLOUTS {} callout kind -> label, for `> [!kind]` + blocks; see rewrite_callouts Every run of links here is a **Markdown list**, which is what each format needs: Mews Profile reads a dated link as a feed entry only when it starts a list item @@ -120,6 +122,9 @@ FOOTNOTE_REF = re.compile(r"\[\^([^\]]+)\]") # citation it was meant to carry. LINKREF_DEF = re.compile(r"^\[(\d+)\]:", re.MULTILINE) +# The opening line of a GitHub/Obsidian-style callout, "> [!kind] title". +CALLOUT = re.compile(r"^([ ]{0,3}>[ ]?)\[!(\w+)\][ \t]*(.*)$", re.MULTILINE) + def rot13(text): """The obfuscation used on addresses in the HTML templates.""" @@ -322,6 +327,33 @@ def rewrite_footnotes(text, labels, warn): return body.rstrip() + "\n\n" + "\n".join(notes) + "\n" +def rewrite_callouts(text, kinds): + """Turn a `> [!kind]` marker into a bold label line, leaving the rest of + the passage an ordinary blockquote. + + The HTML build renders these as boxes (an