mirror of
https://github.com/danbulant/markdown-wasm
synced 2026-05-19 04:18:38 +00:00
readme
This commit is contained in:
parent
9c834e08da
commit
effd662d1c
1 changed files with 22 additions and 5 deletions
27
README.md
27
README.md
|
|
@ -3,9 +3,10 @@
|
|||
Very fast Markdown parser & HTML renderer implemented in WebAssembly
|
||||
|
||||
- Zero dependencies
|
||||
- Portable
|
||||
- Simple API
|
||||
- Fast and efficient
|
||||
- Portable & safe
|
||||
- [Simple API](#api)
|
||||
- [Fast and efficient](#benchmarks)
|
||||
- JS + WASM is only 31 kB gzipped
|
||||
|
||||
Based on [md4c](http://github.com/mity/md4c)
|
||||
|
||||
|
|
@ -19,7 +20,7 @@ const markdown = require("./dist/markdown.node.js")
|
|||
console.log(markdown.parse("# hello\n*world*"))
|
||||
```
|
||||
|
||||
ES module, WASM loaded async from separate file
|
||||
ES module with WASM loaded separately
|
||||
|
||||
```js
|
||||
import * as markdown from "./dist/markdown.es.js"
|
||||
|
|
@ -27,7 +28,7 @@ await markdown.ready
|
|||
console.log(markdown.parse("# hello\n*world*"))
|
||||
```
|
||||
|
||||
In web browser, WASM loaded async from separate file
|
||||
Web browser
|
||||
|
||||
```html
|
||||
<script src="markdown.js"></script>
|
||||
|
|
@ -80,6 +81,8 @@ for each library. Lower numbers are better.
|
|||
|
||||

|
||||
|
||||
See [`test/benchmark`](test/benchmark#readme) for more information.
|
||||
|
||||
|
||||
## API
|
||||
|
||||
|
|
@ -158,3 +161,17 @@ Build debug version of markdown into ./build/debug and watch source files:
|
|||
```
|
||||
npx wasmc -g -w
|
||||
```
|
||||
|
||||
If you need special builds, like for example an ES module with embedded WASM,
|
||||
edit the `wasmc.js` file and add `module({...})` directives.
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
module({ ...m,
|
||||
name: "markdown-custom",
|
||||
out: outdir + "/markdown.custom.js",
|
||||
embed: true,
|
||||
format: "es",
|
||||
})
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue