From 480cbd1ad5a04e0e4978f21f7a6cff3ca3d3f6ae Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Wed, 11 Sep 2024 14:50:43 +0800 Subject: docs: Update README --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 4d297c7..e155b05 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,31 @@ +# Dumbymap + +This library generate web maps from Semantic HTML, see [demo page](https://outdoorsafetylab.github.io/dumbymap/) + +## Getting Started + +Node.js: + +```bash +npm install dumbymap +``` +```js +import { markdown2HTML, generateMaps } from 'dumbymap' + +// Create container element +const container = document.createElement('div') +document.body.append(container) + +// Convert markdown text into Semantic HTML +markdown2HTML(container, '# Heading\n\n```map\nid: foo\nuse: Maplibre\n```\n') + +// Gernerate maps from code block +generateMaps(container) +``` + +browser (CDN): +- [unpkg](https://unpkg.com/dumbymap@0.1.1/dist/dumbymap.mjs) + ## TODOs - Editor -- cgit v1.2.3-70-g09d2