diff --git a/.claude/skills/collect_knowledge/scripts/mdlang.py b/.claude/skills/collect_knowledge/scripts/mdlang.py index 1245d61..58bc7cf 100644 --- a/.claude/skills/collect_knowledge/scripts/mdlang.py +++ b/.claude/skills/collect_knowledge/scripts/mdlang.py @@ -127,12 +127,19 @@ def dominant_script(text: str) -> str | None: CAT_ANCHOR = "anchor" CAT_LINK_TARGET = "link_target" CAT_WIKILINK_TARGET = "wikilink_target" +# Reader-facing content inside fences (decision trees, mermaid labels, quoted UI copy). +CAT_FENCE_DIAGRAM = "fence_diagram" +CAT_MERMAID_LABEL = "mermaid_label" +CAT_CODE_STRING = "code_string" ALL_CATEGORIES = [ CAT_PROSE, CAT_FRONTMATTER, CAT_HEADING, CAT_CODE_COMMENT, + CAT_FENCE_DIAGRAM, + CAT_MERMAID_LABEL, + CAT_CODE_STRING, CAT_ANCHOR, CAT_INLINE_CODE, CAT_CODE, @@ -146,10 +153,28 @@ def dominant_script(text: str) -> str | None: # index. Never merge a file with these. # warn -- probably should be translated, but a literal identifier or a # deliberate quotation is plausible. Surface, do not block. -# info -- expected to stay in the source language (paths, URLs). -DEFAULT_BLOCKING = [CAT_PROSE, CAT_FRONTMATTER, CAT_HEADING, CAT_CODE_COMMENT, CAT_ANCHOR] -DEFAULT_WARN = [CAT_INLINE_CODE, CAT_CODE] -DEFAULT_INFO = [CAT_LINK_TARGET, CAT_WIKILINK_TARGET] +# info -- expected to stay in the source language (paths, URLs, identifiers). +DEFAULT_BLOCKING = [ + CAT_PROSE, + CAT_FRONTMATTER, + CAT_HEADING, + CAT_CODE_COMMENT, + CAT_FENCE_DIAGRAM, + CAT_MERMAID_LABEL, + CAT_CODE_STRING, + CAT_ANCHOR, +] +DEFAULT_WARN = [CAT_INLINE_CODE] +DEFAULT_INFO = [CAT_CODE, CAT_LINK_TARGET, CAT_WIKILINK_TARGET] + +# Fence info strings treated as prose/diagram blocks (not executable code). +DEFAULT_DIAGRAM_FENCE_INFOS = ["", "text", "ascii", "plaintext", "txt", "tree", "diagram"] +# Languages where CJK inside quotes is user-facing example copy. +DEFAULT_STRING_FENCE_LANGS = [ + "yaml", "yml", "json", "jsonc", "python", "py", "toml", + "javascript", "js", "typescript", "ts", "tsx", "go", "rust", + "java", "ruby", "bash", "sh", "shell", "zsh", "graphql", "sql", +] DEFAULT_CONFIG = { @@ -176,6 +201,8 @@ def dominant_script(text: str) -> str | None: # carry explanation and should be translated; surrounding code should not. # Override for corpora dominated by a language this list misses. "comment_prefixes": ["#", "//", "--", "/*", "*", ";", "%", "