Module utils

Module utils 

Source

Re-exports§

pub use crate::processor::collect_markdown_files;

Functions§

capitalize_first
Capitalize the first letter of a string.
clean_anchor_patterns
Clean anchor patterns from text (removes {#anchor-id} patterns). This is useful for cleaning titles and navigation text.
extract_markdown_title
Extract the first heading from markdown content as the page title. Returns None if no heading is found.
extract_title_from_markdown
Extract the first H1 heading from markdown content as the document title. Removes inline anchors and other markup from the title text.
is_markdown_header
Return true if the string looks like a markdown header (starts with #).
load_manpage_urls
Load manpage URL mappings from a JSON file.
never_matching_regex
Create a regex that never matches anything.
process_html_elements
Apply a regex transformation to HTML elements using the provided function. Used by the markdown processor for HTML element transformations.
process_with_error_recovery
Process text with error recovery, converting any processing errors to log messages.
safely_process_markup
Safely process markup with panic recovery and graceful error handling.
slugify
Slugify a string for use as an anchor ID. Converts to lowercase, replaces non-alphanumeric characters with dashes, and trims leading/trailing dashes.
strip_markdown
Strip markdown formatting and return plain text. This processes the markdown through the AST and extracts only text content, excluding code blocks and other formatting.