Skip to main content

extract

Function extract 

Source
pub fn extract(source: &str, anchor: &str) -> Result<String, String>
Expand description

Extract the lines between // docs:begin <anchor> and // docs:end <anchor> in source.

The function removes the markers and trims the common leading indentation.

ยงErrors

Returns an error string if a marker is missing, repeated, or out of order.