From 6feaa0ea9e99fff10bd561b6b7cc45d15aceee9a Mon Sep 17 00:00:00 2001 From: rootiest Date: Mon, 27 Jul 2026 16:59:04 -0400 Subject: [PATCH] build: fix md parsing for file paths with variables Updated the python site builder's regex to correctly parse file paths containing shell variables like $__fish_user_dots_path in comment titles. Also added fish_default_key_bindings to the known shell-heads list so those examples are correctly wrapped in a fenced code block rather than falling through to plain text and getting parsed as MDX headings. --- docs/build-manual.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/build-manual.py b/docs/build-manual.py index eef32c1..cfec06b 100644 --- a/docs/build-manual.py +++ b/docs/build-manual.py @@ -160,6 +160,7 @@ SHELL_HEADS = frozenset( if jobs kitty ls man math mkdir mv nvim npm pacman paru pip pip3 pkg printf python python3 rm set shutdown source string sudo switch systemctl test time tmux touch trash type wget wezterm while yay zellij zypper + fish_default_key_bindings fish_vi_key_bindings """.split() ) @@ -212,7 +213,7 @@ PATH_LINE_RE = re.compile(r"^[~$][\w./{}-]*\.\w+$") # A leading "# in local.fish" / "# local.fish" comment names the file an # example belongs to; promote it to the fence title instead of leaving it # as a literal comment inside the code. -FILENAME_COMMENT_RE = re.compile(r"^#\s*(?:in\s+)?([\w-]+\.\w+)\s*$") +FILENAME_COMMENT_RE = re.compile(r"^#\s*(?:in\s+)?([$~\w./-]+\.\w+)\s*$") CELL_SPLIT = re.compile(r"\s{2,}")