Skip to main content

Module snippets

Module snippets 

Source
Expand description

Sync fenced code blocks in website markdown from anchored regions of source files.

The published docs thus contain exactly the tested example code.

Functionsยง

extract
Extract the lines between // docs:begin <anchor> and // docs:end <anchor> in source.
sync_markdown
Rewrite every <!-- snippet: <relpath>#<anchor> --> ... <!-- /snippet --> block in markdown with the current code from crates_dir/<relpath>.