Markdown parsing utilities — extract code blocks, local links, and tool mentions from SKILL.md content.
CodeBlock
Fields
| Name | Type | Description |
|---|---|---|
lang | String | |
code | String | |
start_line | usize |
Trait Implementations
DebugClonePartialEqEq
extract_code_blocks
pub fn extract_code_blocks(body: &str) -> Vec<CodeBlock>
extract_local_links
pub fn extract_local_links(body: &str) -> Vec<String>
extract_tool_mentions
pub fn extract_tool_mentions(body: &str) -> BTreeSet<String>
Extract tool names genuinely referenced in the body.
Only inline code spans (`Bash`) count as references — bare prose is
ignored, because several tool names (Read, Write, Edit, Agent) are
also common English words and would otherwise flood skills with false
positives. Fenced code blocks are examples/commands, not declarations, so
they are excluded too (Event::Code fires only for inline spans).