Resolve file=path[{ranges}] directives in fenced code-block info
strings, replacing the block’s body with the file contents (optionally
sliced by 1-based line ranges).
Replace <ComponentPreview name="X" /> with a CodeBlock carrying the
source of registry component X. registry_index is the JSON manifest;
registry_root is the directory referenced paths resolve against.
Resolve <ComponentSource path="..." /> JSX nodes by reading the
referenced file (or directory of files) and injecting one
CodeBlock child per file. The JSX wrapper stays so consumers can
render Preview/Code chrome around the resolved source. PrettyCode
then highlights every injected CodeBlock natively.
Copy referenced asset files (image srcs and relative hrefs) into
assets_dir, hash-name them via name_template, and rewrite the AST
node to point at the published URL under base_url. map caches
raw -> url so repeated references hash the file only once.
Serialise GFM-only constructs back to plain markdown. ~~strike~~
becomes literal text, tables flatten to pipe-delimited text, task list
items lose their checkbox state and become plain list items.
Detect npm install ..., npx create-..., and npx ... first-lines in
fenced code blocks and replace them with a <PackageManagerTabs> JSX
element carrying the per-pm equivalents as plain string attrs.