create-markdown 0.2.0 â 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/dist/index.cjs +2 -1
- package/dist/index.js +2 -1
- package/dist/parsers/inline.d.ts.map +1 -1
- package/dist/react/index.cjs +2 -1
- package/dist/react/index.js +2 -1
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -13,8 +13,10 @@ A complete block-based markdown notes package with zero dependencies. Parse, cre
|
|
|
13
13
|
- ð **Bidirectional conversion** - Parse markdown to blocks, serialize blocks to markdown
|
|
14
14
|
- ð **Rich inline styles** - Bold, italic, code, links, strikethrough, highlights
|
|
15
15
|
- âïļ **React components** - Optional React bindings for rendering and editing
|
|
16
|
+
- âĻ **Live WYSIWYG editing** - Interactive playground with real-time markdown rendering
|
|
16
17
|
- ðŠķ **Zero dependencies** - Core package has no runtime dependencies
|
|
17
18
|
- ð **Full TypeScript** - Complete type definitions with generics
|
|
19
|
+
- ð **Framework ready** - Works with Next.js, Vite, Remix, Astro, and more
|
|
18
20
|
|
|
19
21
|
## Installation
|
|
20
22
|
|
|
@@ -218,6 +220,36 @@ const content = [
|
|
|
218
220
|
- `useMarkdown(initialMarkdown?)` - Bidirectional markdown/blocks
|
|
219
221
|
- `useBlockEditor(doc)` - Selection and editing operations
|
|
220
222
|
|
|
223
|
+
## Integration
|
|
224
|
+
|
|
225
|
+
For detailed framework-specific setup guides, see the **[Integration Guide](./INTEGRATION.md)**.
|
|
226
|
+
|
|
227
|
+
Quick links:
|
|
228
|
+
- [Next.js (App Router)](./INTEGRATION.md#nextjs-app-router)
|
|
229
|
+
- [Next.js (Pages Router)](./INTEGRATION.md#nextjs-pages-router)
|
|
230
|
+
- [Vite + React](./INTEGRATION.md#vite--react)
|
|
231
|
+
- [Remix](./INTEGRATION.md#remix)
|
|
232
|
+
- [Astro](./INTEGRATION.md#astro)
|
|
233
|
+
- [Node.js / Server-side](./INTEGRATION.md#nodejs--server-side)
|
|
234
|
+
|
|
235
|
+
## Playground
|
|
236
|
+
|
|
237
|
+
The package includes a full WYSIWYG playground editor demonstrating all features:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
# Run the interactive playground
|
|
241
|
+
bun run playground
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
**Playground Features:**
|
|
245
|
+
- Click-to-edit blocks with live markdown rendering
|
|
246
|
+
- Markdown shortcuts (`#` headings, `-` lists, `>` quotes, ``` code, `---` dividers)
|
|
247
|
+
- Inline formatting (`**bold**`, `*italic*`, `` `code` ``, `~~strike~~`, `==highlight==`, `[link](url)`)
|
|
248
|
+
- Keyboard shortcuts (Cmd/Ctrl+B, Cmd/Ctrl+I, Cmd/Ctrl+U)
|
|
249
|
+
- List item management with Enter/Backspace/Tab
|
|
250
|
+
- Dark/light theme toggle
|
|
251
|
+
- Export to markdown
|
|
252
|
+
|
|
221
253
|
## Development
|
|
222
254
|
|
|
223
255
|
```bash
|
|
@@ -240,6 +272,15 @@ bun run playground
|
|
|
240
272
|
- Bun 1.0+ (for development)
|
|
241
273
|
- React 18+ (optional, for React components)
|
|
242
274
|
|
|
275
|
+
## Documentation
|
|
276
|
+
|
|
277
|
+
| Document | Description |
|
|
278
|
+
|----------|-------------|
|
|
279
|
+
| [README.md](./README.md) | Quick start and API overview |
|
|
280
|
+
| [INTEGRATION.md](./INTEGRATION.md) | Framework-specific setup guides |
|
|
281
|
+
| [CONTRIBUTING.md](./CONTRIBUTING.md) | Contribution guidelines |
|
|
282
|
+
| [CHANGELOG.md](./CHANGELOG.md) | Version history |
|
|
283
|
+
|
|
243
284
|
## Contributing
|
|
244
285
|
|
|
245
286
|
We welcome contributions! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
package/dist/index.cjs
CHANGED
|
@@ -1273,7 +1273,8 @@ function matchLink(text2, start, isImage = false) {
|
|
|
1273
1273
|
url = titleMatch[1];
|
|
1274
1274
|
title = titleMatch[2];
|
|
1275
1275
|
}
|
|
1276
|
-
const
|
|
1276
|
+
const children = parseInlineTokens(linkText);
|
|
1277
|
+
const token = isImage ? { type: "image", content: linkText, url, title, children } : { type: "link", content: linkText, url, title, children };
|
|
1277
1278
|
return {
|
|
1278
1279
|
token,
|
|
1279
1280
|
end: isImage ? urlEnd + 1 : urlEnd
|
package/dist/index.js
CHANGED
|
@@ -1133,7 +1133,8 @@ function matchLink(text2, start, isImage = false) {
|
|
|
1133
1133
|
url = titleMatch[1];
|
|
1134
1134
|
title = titleMatch[2];
|
|
1135
1135
|
}
|
|
1136
|
-
const
|
|
1136
|
+
const children = parseInlineTokens(linkText);
|
|
1137
|
+
const token = isImage ? { type: "image", content: linkText, url, title, children } : { type: "link", content: linkText, url, title, children };
|
|
1137
1138
|
return {
|
|
1138
1139
|
token,
|
|
1139
1140
|
end: isImage ? urlEnd + 1 : urlEnd
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/parsers/inline.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,UAAU,CAAC;AAkBtD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE,CAO3D;
|
|
1
|
+
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/parsers/inline.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,UAAU,CAAC;AAkBtD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE,CAO3D;AAsfD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGrD"}
|
package/dist/react/index.cjs
CHANGED
|
@@ -898,7 +898,8 @@ function matchLink(text, start, isImage = false) {
|
|
|
898
898
|
url = titleMatch[1];
|
|
899
899
|
title = titleMatch[2];
|
|
900
900
|
}
|
|
901
|
-
const
|
|
901
|
+
const children = parseInlineTokens(linkText);
|
|
902
|
+
const token = isImage ? { type: "image", content: linkText, url, title, children } : { type: "link", content: linkText, url, title, children };
|
|
902
903
|
return {
|
|
903
904
|
token,
|
|
904
905
|
end: isImage ? urlEnd + 1 : urlEnd
|
package/dist/react/index.js
CHANGED
|
@@ -836,7 +836,8 @@ function matchLink(text, start, isImage = false) {
|
|
|
836
836
|
url = titleMatch[1];
|
|
837
837
|
title = titleMatch[2];
|
|
838
838
|
}
|
|
839
|
-
const
|
|
839
|
+
const children = parseInlineTokens(linkText);
|
|
840
|
+
const token = isImage ? { type: "image", content: linkText, url, title, children } : { type: "link", content: linkText, url, title, children };
|
|
840
841
|
return {
|
|
841
842
|
token,
|
|
842
843
|
end: isImage ? urlEnd + 1 : urlEnd
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-markdown",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"author": "Val Alexander <val@viewdue.ai>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -62,8 +62,7 @@
|
|
|
62
62
|
"build:types": "tsc --emitDeclarationOnly --declaration --outDir dist",
|
|
63
63
|
"dev": "bun run --watch src/index.ts",
|
|
64
64
|
"clean": "rm -rf dist",
|
|
65
|
-
"
|
|
66
|
-
"publish": "bun publish --access public",
|
|
65
|
+
"prepublishOnly": "bun run clean && bun run build",
|
|
67
66
|
"deploy": "./deploy.sh",
|
|
68
67
|
"playground": "bun run build && cd playground && bun dev",
|
|
69
68
|
"playground:install": "cd playground && bun install",
|