Skip to main content

extract_documentation_as_text

Function extract_documentation_as_text 

Source
pub fn extract_documentation_as_text(html: &str) -> String
Expand description

Extract documentation from HTML as plain text.

Mirrors extract_documentation but produces plain text: it isolates the main content area (dropping navigation, sidebars and footers), runs the shared clean_html pass (which strips scripts, styles, navigation, buttons, <details> toggles and UI labels such as “Copy item path” and “Expand description”), then flattens to text. Finally, leftover section anchor markers are removed since they carry no meaning once hyperlinks are gone.