packages/mdcode/README.md documents the CLI only. The package also ships a programmatic API via zshy exports (. → src/index.ts, ./cli → src/cli.ts), which is undocumented.
Worth covering:
parse({ source, filter }) / walk() — block shape, position offsets, metadata extraction.
region.read(source, name, lang?), region.outline(source), region.replace(source, name, newContent, lang?) — note the optional lang param, which selects the comment style (// vs # vs <!--); omitting it falls back to // and /* */ only.
region.getCommentStyle(lang).
- Command functions and their option types:
extract (incl. force), update, list, run, dump.
defineTransform() — already shown in CLAUDE.md but not in the README.
Prompted by #21: replace() gained an optional lang argument with no place to document it.
packages/mdcode/README.mddocuments the CLI only. The package also ships a programmatic API viazshyexports (.→src/index.ts,./cli→src/cli.ts), which is undocumented.Worth covering:
parse({ source, filter })/walk()— block shape,positionoffsets, metadata extraction.region.read(source, name, lang?),region.outline(source),region.replace(source, name, newContent, lang?)— note the optionallangparam, which selects the comment style (//vs#vs<!--); omitting it falls back to//and/* */only.region.getCommentStyle(lang).extract(incl.force),update,list,run,dump.defineTransform()— already shown in CLAUDE.md but not in the README.Prompted by #21:
replace()gained an optionallangargument with no place to document it.