Skip to main content

Crate web2md

Crate web2md 

Source

Structs§

Browser
Minimal HTTP client: fetches raw HTML only. No rendering engine—intentionally lightweight for MCP token efficiency.
BrowserOptions
Configuration for the HTTP client
Interpreter
A self-contained JS interpreter instance with its own global scope and document write buffer.
McpRequest
MCP tool request schema
McpResponse
MCP tool response schema
McpServer
MCP server wrapping the Browser
PageMetadata
Metadata extracted from an HTML page. Used by both the MCP server and the CLI --format json output.
PageToMarkdown
Convert raw HTML to clean Markdown. Strips scripts, styles, and non-essential markup to minimize token output.

Functions§

extract_feed_links
Extract feed URLs (RSS/Atom) from HTML tags. Looks for and .
extract_metadata
Extract metadata (title, description, author, publication date, image, headline, site name, keywords) from HTML.
init
Initialize global defaults.
inject_before_body_close
Inject html_fragment into html just before </body> (case-insensitive); fall back to </html> then to appending at the end.
parse_sitemap_urls
Parse URLs from sitemap XML content. Extracts all <loc> tag values from sitemap.xml format.
run_inline_scripts
Run every inline <script> block in html through a fresh interpreter and return the concatenated HTML captured via document.write / writeln.