Skip to main content

sync_markdown

Function sync_markdown 

Source
pub fn sync_markdown(
    markdown: &str,
    crates_dir: &Path,
) -> Result<String, String>
Expand description

Rewrite every <!-- snippet: <relpath>#<anchor> --> ... <!-- /snippet --> block in markdown with the current code from crates_dir/<relpath>.

The function returns the new markdown. It is idempotent.

ยงErrors

Returns an error if a referenced source file or anchor cannot be read.