Mercurial
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 191:a06710325c30 | 192:b818a4561a3c |
|---|---|
| 1 # markdown_converter | |
| 2 | |
| 3 Markdown to HTML converter written in C, with WASM support for browser use. | |
| 4 | |
| 5 ## Features | |
| 6 | |
| 7 - Headings, paragraphs, lists | |
| 8 - Code blocks with syntax highlighting | |
| 9 - Links and images | |
| 10 - Bold, italic, inline code | |
| 11 - Blockquotes | |
| 12 | |
| 13 ## Files | |
| 14 | |
| 15 | File | Description | | |
| 16 |------|-------------| | |
| 17 | `markdown_to_html.h` | Public API header | | |
| 18 | `markdown_to_html.c` | C implementation | | |
| 19 | `markdown_to_html.js` | JavaScript wrapper for WASM | | |
| 20 | `markdown_to_html.css` | Default styles | | |
| 21 | `tests/` | Test cases | | |
| 22 | |
| 23 ## Usage (C) | |
| 24 | |
| 25 ```c | |
| 26 #include "markdown_converter/markdown_to_html.h" | |
| 27 | |
| 28 char* html = markdown_to_html(markdown_string); | |
| 29 // use html... | |
| 30 markdown_free(html); | |
| 31 ``` | |
| 32 | |
| 33 ## Usage (WASM/JavaScript) | |
| 34 | |
| 35 ```javascript | |
| 36 import createModule from 'markdown_converter/markdown_to_html_wasm/markdown_to_html_bin.js'; | |
| 37 | |
| 38 const Module = await createModule(); | |
| 39 const toHtml = Module.cwrap('markdown_to_html', 'number', ['string']); | |
| 40 const free = Module.cwrap('markdown_free', null, ['number']); | |
| 41 | |
| 42 const ptr = toHtml(markdownString); | |
| 43 const html = Module.UTF8ToString(ptr); | |
| 44 free(ptr); | |
| 45 ``` | |
| 46 | |
| 47 ## Building | |
| 48 | |
| 49 ```bash | |
| 50 bazel build //markdown_converter:markdown_to_html | |
| 51 bazel build //markdown_converter:markdown_to_html_wasm # WASM version | |
| 52 ``` |