@wireweave/markdown-plugin 1.2.12-beta.11 → 1.2.12-beta.13
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 +15 -94
- package/package.json +17 -20
package/README.md
CHANGED
|
@@ -1,108 +1,29 @@
|
|
|
1
1
|
# @wireweave/markdown-plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Markdown adapters that render Wireweave code fences through Core.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The [public tool contract](../../docs/spec/TOOLING.md#editor-integrations) defines this package's APIs, behavior, configuration and compatibility. The [language contract](../../docs/spec/LANGUAGE.md) defines the DSL. [Package metadata](package.json) owns package versions, exports, dependencies and scripts.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- `@wireweave/markdown-plugin/markdown-it`
|
|
12
|
-
- `@wireweave/markdown-plugin/marked`
|
|
13
|
-
- `@wireweave/markdown-plugin/remarkable`
|
|
14
|
-
|
|
15
|
-
Each engine is an **optional peer dependency** — install only the one you use. The package root also exports `renderWireframe`, the standalone renderer the adapters are built on.
|
|
16
|
-
|
|
17
|
-
## Install
|
|
9
|
+
Use Node.js >=22.13.0. Replace `<pinned-version>` with the release selected for your toolchain.
|
|
18
10
|
|
|
19
11
|
```bash
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
A fenced block tagged `wireframe` is rendered:
|
|
26
|
-
|
|
27
|
-
````markdown
|
|
28
|
-
```wireframe
|
|
29
|
-
page "Home" {
|
|
30
|
-
button "Get Started" primary
|
|
31
|
-
}
|
|
12
|
+
pnpm add --save-exact '@wireweave/markdown-plugin@<pinned-version>'
|
|
32
13
|
```
|
|
33
|
-
````
|
|
34
|
-
|
|
35
|
-
### markdown-it
|
|
36
14
|
|
|
37
|
-
|
|
38
|
-
import MarkdownIt from 'markdown-it'
|
|
39
|
-
import { markdownItWireframe } from '@wireweave/markdown-plugin/markdown-it'
|
|
15
|
+
Install the Markdown engine used by your selected adapter as a peer dependency. Adapter entries and registration are defined by the tool contract.
|
|
40
16
|
|
|
41
|
-
|
|
42
|
-
md.use(markdownItWireframe, { format: 'svg-img', theme: 'light' })
|
|
43
|
-
|
|
44
|
-
const html = md.render(source)
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### marked
|
|
48
|
-
|
|
49
|
-
```typescript
|
|
50
|
-
import { marked } from 'marked'
|
|
51
|
-
import { markedWireframe } from '@wireweave/markdown-plugin/marked'
|
|
52
|
-
|
|
53
|
-
marked.use(markedWireframe({ format: 'svg', theme: 'dark' }))
|
|
54
|
-
|
|
55
|
-
const html = marked.parse(source)
|
|
56
|
-
```
|
|
17
|
+
## Development
|
|
57
18
|
|
|
58
|
-
|
|
19
|
+
Run from the monorepo root after the [workspace setup](../../README.md).
|
|
59
20
|
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const html = md.render(source)
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Standalone renderer
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
import { renderWireframe } from '@wireweave/markdown-plugin'
|
|
74
|
-
|
|
75
|
-
const html = renderWireframe('page { button "OK" primary }', {
|
|
76
|
-
format: 'html',
|
|
77
|
-
theme: 'light',
|
|
78
|
-
})
|
|
21
|
+
```bash
|
|
22
|
+
pnpm --filter @wireweave/markdown-plugin run build
|
|
23
|
+
pnpm --filter @wireweave/markdown-plugin run typecheck
|
|
24
|
+
pnpm --filter @wireweave/markdown-plugin run lint
|
|
25
|
+
pnpm --filter @wireweave/markdown-plugin run test
|
|
26
|
+
pnpm --filter @wireweave/markdown-plugin run format:check
|
|
79
27
|
```
|
|
80
28
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
`WireframePluginOptions`:
|
|
84
|
-
|
|
85
|
-
| Option | Values | Default | Description |
|
|
86
|
-
| ---------------- | ------------------------------------------------------ | ----------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
87
|
-
| `format` | `'html'` \| `'html-preview'` \| `'svg'` \| `'svg-img'` | `'svg-img'` | Output format. `html-preview` wraps output in a scalable preview container; `svg-img` emits a base64-encoded `<img>`. |
|
|
88
|
-
| `theme` | `'light'` \| `'dark'` | `'light'` | Rendering theme. |
|
|
89
|
-
| `containerClass` | `string` | `'wireframe-container'` | Wrapper element class. |
|
|
90
|
-
| `errorHandling` | `'code'` \| `'error'` \| `'both'` | `'both'` | What to show when a block fails to parse. |
|
|
91
|
-
| `containerWidth` | `number` | `0` | Target width (px) for `html-preview` scaling. `0` disables scaling. |
|
|
92
|
-
| `maxScale` | `number` | `1` | Upper bound on the preview scale factor. |
|
|
93
|
-
|
|
94
|
-
## Main API
|
|
95
|
-
|
|
96
|
-
| Export | Description |
|
|
97
|
-
| -------------------------------------- | -------------------------------------- |
|
|
98
|
-
| `renderWireframe(code, options?)` | Render a DSL string to an HTML string. |
|
|
99
|
-
| `markdownItWireframe` (`/markdown-it`) | markdown-it plugin. |
|
|
100
|
-
| `markedWireframe` (`/marked`) | marked extension factory. |
|
|
101
|
-
| `remarkableWireframe` (`/remarkable`) | remarkable plugin. |
|
|
102
|
-
| `WireframePluginOptions` | Shared options type. |
|
|
103
|
-
|
|
104
|
-
Part of the [Wireweave monorepo](https://github.com/wireweave/wireweave).
|
|
105
|
-
|
|
106
|
-
## License
|
|
107
|
-
|
|
108
|
-
MIT
|
|
29
|
+
License: MIT.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wireweave/markdown-plugin",
|
|
3
|
-
"version": "1.2.12-beta.
|
|
3
|
+
"version": "1.2.12-beta.13",
|
|
4
4
|
"description": "Markdown plugins for wireweave",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -73,30 +73,28 @@
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@wireweave/core": "
|
|
76
|
+
"@wireweave/core": "4.0.0-beta.13"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@commitlint/cli": "^21.
|
|
80
|
-
"@commitlint/config-conventional": "^21.
|
|
79
|
+
"@commitlint/cli": "^21.2.2",
|
|
80
|
+
"@commitlint/config-conventional": "^21.2.2",
|
|
81
81
|
"@eslint/js": "^10.0.1",
|
|
82
|
-
"@
|
|
83
|
-
"@types/
|
|
84
|
-
"@types/node": "^22",
|
|
82
|
+
"@types/markdown-it": "^14.2.0",
|
|
83
|
+
"@types/node": "^22.20.2",
|
|
85
84
|
"@types/remarkable": "^2.0.8",
|
|
86
|
-
"eslint": "^10.
|
|
85
|
+
"eslint": "^10.10.0",
|
|
87
86
|
"husky": "^9.1.7",
|
|
88
|
-
"knip": "^6.
|
|
89
|
-
"lint-staged": "^
|
|
90
|
-
"markdown-it": "^14.
|
|
91
|
-
"marked": "^15.0.
|
|
92
|
-
"prettier": "^3.
|
|
93
|
-
"publint": "^0.3.
|
|
94
|
-
"release-it": "^19.2.3",
|
|
87
|
+
"knip": "^6.35.1",
|
|
88
|
+
"lint-staged": "^16.4.0",
|
|
89
|
+
"markdown-it": "^14.3.2",
|
|
90
|
+
"marked": "^15.0.12",
|
|
91
|
+
"prettier": "^3.9.6",
|
|
92
|
+
"publint": "^0.3.24",
|
|
95
93
|
"remarkable": "^2.0.1",
|
|
96
|
-
"tsup": "^8.
|
|
97
|
-
"typescript": "^5.
|
|
98
|
-
"typescript-eslint": "^8.
|
|
99
|
-
"vitest": "^
|
|
94
|
+
"tsup": "^8.5.1",
|
|
95
|
+
"typescript": "^5.9.3",
|
|
96
|
+
"typescript-eslint": "^8.70.0",
|
|
97
|
+
"vitest": "^4.1.11"
|
|
100
98
|
},
|
|
101
99
|
"keywords": [
|
|
102
100
|
"wireframe",
|
|
@@ -119,7 +117,6 @@
|
|
|
119
117
|
"test": "vitest run",
|
|
120
118
|
"test:watch": "vitest",
|
|
121
119
|
"clean": "rm -rf dist",
|
|
122
|
-
"release": "release-it",
|
|
123
120
|
"typecheck": "tsc --noEmit",
|
|
124
121
|
"lint": "eslint .",
|
|
125
122
|
"lint:fix": "eslint . --fix",
|