You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then browse the generated Markdown files in `preview-output/` or render them with your preferred viewer.
353
+
354
+
## Commit conventions
355
+
356
+
This project uses [Conventional Commits](https://www.conventionalcommits.org/) and [Release Please](https://github.com/googleapis/release-please) for automated versioning and changelog generation.
357
+
358
+
### Commit message format
359
+
360
+
```
361
+
<type>[optional scope]: <description>
362
+
363
+
[optional body]
364
+
365
+
[optional footer(s)]
362
366
```
363
367
364
-
Then browse the generated Markdown files or render them with your preferred viewer.
368
+
### Types
369
+
370
+
| Type | Purpose | Version bump |
371
+
|---|---|---|
372
+
|`feat`| New feature or capability | minor (0.x → 0.x+1) |
373
+
|`fix`| Bug fix | patch (0.x.y → 0.x.y+1) |
374
+
|`perf`| Performance improvement | patch |
375
+
|`docs`| Documentation only | none |
376
+
|`test`| Adding or updating tests | none |
377
+
|`refactor`| Code change that neither fixes a bug nor adds a feature | none |
378
+
|`chore`| Maintenance tasks (deps, CI config) | none |
379
+
|`ci`| CI/CD workflow changes | none |
380
+
381
+
### Breaking changes
382
+
383
+
Append `!` after the type to indicate a breaking change:
384
+
385
+
```
386
+
feat!: rename diagramFormat option to svgMode
387
+
```
388
+
389
+
Or include a `BREAKING CHANGE:` footer:
390
+
391
+
```
392
+
feat: overhaul diagram rendering pipeline
393
+
394
+
BREAKING CHANGE: diagramFormat option renamed to svgMode
395
+
```
396
+
397
+
Breaking changes bump the major version (or minor while pre-1.0).
398
+
399
+
### Examples
400
+
401
+
```
402
+
feat: add diagramEmbed option for inline SVG embedding
403
+
fix: use descriptive alt text in SVG image references
404
+
docs: document responsive wrapper behavior
405
+
refactor: extract wrapResponsive helper from processDiagrams
406
+
test: add inline SVG embedding tests
407
+
chore: update dev dependencies
408
+
```
409
+
410
+
### How it works
411
+
412
+
1. You merge PRs to `main` using conventional commit messages
413
+
2. Release Please reads the commit history and opens a "Release PR" with a version bump and auto-generated `CHANGELOG.md`
414
+
3. Merging the Release PR creates a GitHub Release, which triggers the npm publish workflow
Copy file name to clipboardExpand all lines: README.md
+33-4Lines changed: 33 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -142,6 +142,7 @@ plugin documentation {
142
142
generateErd = true
143
143
erdTheme = 'github-light'
144
144
diagramFormat = 'svg'
145
+
diagramEmbed = 'inline'
145
146
}
146
147
```
147
148
@@ -160,6 +161,7 @@ plugin documentation {
160
161
|`erdFormat`|`"svg"`, `"mmd"`, or `"both"`|`"both"`| Which ERD output format(s) to produce |
161
162
|`erdTheme`|`string`| default |[beautiful-mermaid](https://github.com/lukilabs/beautiful-mermaid) theme name for SVG rendering |
162
163
|`diagramFormat`|`"mermaid"`, `"svg"`, or `"both"`|`"mermaid"`| How per-page Mermaid diagrams are rendered (see [Per-Page SVG Diagrams](#per-page-svg-diagrams)) |
164
+
|`diagramEmbed`|`"file"` or `"inline"`|`"file"`| Whether SVGs are written as companion files or embedded directly in the markdown (see [Per-Page SVG Diagrams](#per-page-svg-diagrams)) |
163
165
164
166
## ERD SVG Export
165
167
@@ -188,7 +190,7 @@ See all 15 themes rendered against the showcase schema in the [theme gallery](./
188
190
189
191
## Per-Page SVG Diagrams
190
192
191
-
By default, diagrams on model, view, enum, type, procedure, and relationship pages are rendered as inline Mermaid code blocks. Set `diagramFormat` to render them as SVG images instead:
193
+
By default, diagrams on model, view, enum, type, procedure, relationship, and SKILL pages are rendered as inline Mermaid code blocks. Set `diagramFormat` to render them as SVG images instead:
|`"svg"`| SVG content embedded directly in the markdown — works everywhere, including Notion, plain Markdown viewers, and GitHub |
206
-
|`"both"`| Embedded SVG with the Mermaid source in a collapsible `<details>` block |
209
+
|`"svg"`| Companion `.svg` files referenced via `` — works everywhere |
210
+
|`"both"`| SVG image reference with the Mermaid source in a collapsible `<details>` block |
211
+
212
+
### Embed mode
213
+
214
+
Control whether SVGs are written as separate files or embedded directly in the markdown:
215
+
216
+
```prisma
217
+
plugin documentation {
218
+
provider = 'zenstack-docs-plugin'
219
+
output = './docs/schema'
220
+
diagramFormat = 'svg'
221
+
diagramEmbed = 'inline'
222
+
}
223
+
```
224
+
225
+
| Value | Behavior |
226
+
|---|---|
227
+
|`"file"`| SVG written as companion files next to each `.md` page (default) |
228
+
|`"inline"`| Raw `<svg>` XML embedded directly in the markdown — fully self-contained, no separate files |
229
+
230
+
The `diagramEmbed` option only takes effect when `diagramFormat` is `"svg"` or `"both"`.
231
+
232
+
### Additional features
233
+
234
+
-**Descriptive alt text** — image references use the entity name (e.g. `![User diagram]`) for accessibility and hover tooltips
235
+
-**Responsive wrapper** — all SVG outputs (file references and inline) are wrapped in `<div style="max-width:100%;overflow-x:auto">` so large diagrams scroll horizontally instead of overflowing the page
207
236
208
-
When set to `"svg"` or `"both"`, the rendered SVG is embedded inline in each `.md` page — no separate files needed. The `erdTheme` option applies to all per-page SVGs as well as the standalone ERD.
237
+
The `erdTheme` option applies to all per-page SVGs as well as the standalone ERD.
0 commit comments