generate_html
Convert Markdown to a complete, self-contained HTML document with inlined styles and KaTeX math. Returns the HTML string directly for browser rendering without writing files.
Instructions
Generate a complete, self-contained HTML document from Markdown with all styles inlined. Renders GFM (tables, task lists, strikethrough) and KaTeX math into a full HTML page with an embedded block and a KaTeX CSS CDN link. Returns the HTML string directly — no file is written to disk. Side effects: none. This tool is read-only and performs no file I/O. Returns: a complete HTML document string (…) with inline styles, ready for rendering in a browser. The optional title parameter sets the tag in the HTML section. Use this when you need styled HTML output returned as a string (e.g., for embedding in responses or previewing). Prefer convert_to_html when you need to write the HTML to a file on disk. Prefer convert_to_pdf or convert_to_image for non-HTML visual output formats.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| markdown | Yes | The raw Markdown source text to convert. Supports GitHub-Flavored Markdown (tables, task lists, strikethrough) and KaTeX math expressions. Pass the full document content as a string, not a file path. | |
| title | No | Optional. Sets the <title> tag in the HTML document's <head> section. Displayed in browser tabs and bookmarks. Defaults to 'Document' if omitted. |