Mercurial
diff markdown_converter/README.md @ 192:b818a4561a3c hg-web
Added AI genreated README.md. Needed to be read.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Sat, 24 Jan 2026 21:52:14 -0800 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/markdown_converter/README.md Sat Jan 24 21:52:14 2026 -0800 @@ -0,0 +1,52 @@ +# markdown_converter + +Markdown to HTML converter written in C, with WASM support for browser use. + +## Features + +- Headings, paragraphs, lists +- Code blocks with syntax highlighting +- Links and images +- Bold, italic, inline code +- Blockquotes + +## Files + +| File | Description | +|------|-------------| +| `markdown_to_html.h` | Public API header | +| `markdown_to_html.c` | C implementation | +| `markdown_to_html.js` | JavaScript wrapper for WASM | +| `markdown_to_html.css` | Default styles | +| `tests/` | Test cases | + +## Usage (C) + +```c +#include "markdown_converter/markdown_to_html.h" + +char* html = markdown_to_html(markdown_string); +// use html... +markdown_free(html); +``` + +## Usage (WASM/JavaScript) + +```javascript +import createModule from 'markdown_converter/markdown_to_html_wasm/markdown_to_html_bin.js'; + +const Module = await createModule(); +const toHtml = Module.cwrap('markdown_to_html', 'number', ['string']); +const free = Module.cwrap('markdown_free', null, ['number']); + +const ptr = toHtml(markdownString); +const html = Module.UTF8ToString(ptr); +free(ptr); +``` + +## Building + +```bash +bazel build //markdown_converter:markdown_to_html +bazel build //markdown_converter:markdown_to_html_wasm # WASM version +```