@slidev/cli 52.11.3 → 52.11.5
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/dist/{build-CBdhBv4d.mjs → build-DnSiH_hX.mjs} +1 -1
- package/dist/cli.mjs +3 -6
- package/dist/index.mjs +2 -2
- package/dist/{serve-jpCd8QH_.mjs → serve-imvXJyRN.mjs} +1 -1
- package/dist/{shared-Ba3UGXDn.mjs → shared-DHY1ulq4.mjs} +1 -1
- package/package.json +17 -16
- package/skills/GENERATION.md +227 -0
- package/skills/slidev/README.md +61 -0
- package/skills/slidev/SKILL.md +183 -0
- package/skills/slidev/references/animation-click-marker.md +37 -0
- package/skills/slidev/references/animation-drawing.md +68 -0
- package/skills/slidev/references/animation-rough-marker.md +53 -0
- package/skills/slidev/references/api-slide-hooks.md +37 -0
- package/skills/slidev/references/build-og-image.md +36 -0
- package/skills/slidev/references/build-pdf.md +40 -0
- package/skills/slidev/references/build-remote-assets.md +34 -0
- package/skills/slidev/references/build-seo-meta.md +43 -0
- package/skills/slidev/references/code-groups.md +64 -0
- package/skills/slidev/references/code-import-snippet.md +55 -0
- package/skills/slidev/references/code-line-highlighting.md +50 -0
- package/skills/slidev/references/code-line-numbers.md +46 -0
- package/skills/slidev/references/code-magic-move.md +57 -0
- package/skills/slidev/references/code-max-height.md +37 -0
- package/skills/slidev/references/code-twoslash.md +42 -0
- package/skills/slidev/references/core-animations.md +196 -0
- package/skills/slidev/references/core-cli.md +140 -0
- package/skills/slidev/references/core-components.md +197 -0
- package/skills/slidev/references/core-exporting.md +148 -0
- package/skills/slidev/references/core-frontmatter.md +195 -0
- package/skills/slidev/references/core-global-context.md +155 -0
- package/skills/slidev/references/core-headmatter.md +188 -0
- package/skills/slidev/references/core-hosting.md +152 -0
- package/skills/slidev/references/core-layouts.md +286 -0
- package/skills/slidev/references/core-syntax.md +155 -0
- package/skills/slidev/references/diagram-latex.md +55 -0
- package/skills/slidev/references/diagram-mermaid.md +44 -0
- package/skills/slidev/references/diagram-plantuml.md +45 -0
- package/skills/slidev/references/editor-monaco-run.md +44 -0
- package/skills/slidev/references/editor-monaco-write.md +24 -0
- package/skills/slidev/references/editor-monaco.md +50 -0
- package/skills/slidev/references/editor-prettier.md +40 -0
- package/skills/slidev/references/editor-side.md +23 -0
- package/skills/slidev/references/editor-vscode.md +55 -0
- package/skills/slidev/references/layout-canvas-size.md +25 -0
- package/skills/slidev/references/layout-draggable.md +57 -0
- package/skills/slidev/references/layout-global-layers.md +50 -0
- package/skills/slidev/references/layout-slots.md +75 -0
- package/skills/slidev/references/layout-transform.md +33 -0
- package/skills/slidev/references/layout-zoom.md +39 -0
- package/skills/slidev/references/presenter-notes-ruby.md +35 -0
- package/skills/slidev/references/presenter-recording.md +30 -0
- package/skills/slidev/references/presenter-remote.md +40 -0
- package/skills/slidev/references/presenter-timer.md +34 -0
- package/skills/slidev/references/style-direction.md +34 -0
- package/skills/slidev/references/style-icons.md +46 -0
- package/skills/slidev/references/style-scoped.md +50 -0
- package/skills/slidev/references/syntax-block-frontmatter.md +39 -0
- package/skills/slidev/references/syntax-frontmatter-merging.md +49 -0
- package/skills/slidev/references/syntax-importing-slides.md +60 -0
- package/skills/slidev/references/syntax-mdc.md +51 -0
- package/skills/slidev/references/tool-eject-theme.md +27 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: layouts
|
|
3
|
+
description: Available layouts for slides
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Built-in Layouts
|
|
7
|
+
|
|
8
|
+
Available layouts for slides.
|
|
9
|
+
|
|
10
|
+
## Basic Layouts
|
|
11
|
+
|
|
12
|
+
### default
|
|
13
|
+
|
|
14
|
+
Standard slide layout.
|
|
15
|
+
```yaml
|
|
16
|
+
---
|
|
17
|
+
layout: default
|
|
18
|
+
---
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### center
|
|
22
|
+
|
|
23
|
+
Content centered horizontally and vertically.
|
|
24
|
+
```yaml
|
|
25
|
+
---
|
|
26
|
+
layout: center
|
|
27
|
+
---
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### cover
|
|
31
|
+
|
|
32
|
+
Title/cover slide with centered content.
|
|
33
|
+
```yaml
|
|
34
|
+
---
|
|
35
|
+
layout: cover
|
|
36
|
+
---
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### end
|
|
40
|
+
|
|
41
|
+
End slide.
|
|
42
|
+
```yaml
|
|
43
|
+
---
|
|
44
|
+
layout: end
|
|
45
|
+
---
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### full
|
|
49
|
+
|
|
50
|
+
Full-screen content, no padding.
|
|
51
|
+
```yaml
|
|
52
|
+
---
|
|
53
|
+
layout: full
|
|
54
|
+
---
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### none
|
|
58
|
+
|
|
59
|
+
No layout styling.
|
|
60
|
+
```yaml
|
|
61
|
+
---
|
|
62
|
+
layout: none
|
|
63
|
+
---
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Text Layouts
|
|
67
|
+
|
|
68
|
+
### intro
|
|
69
|
+
|
|
70
|
+
Introduction slide.
|
|
71
|
+
```yaml
|
|
72
|
+
---
|
|
73
|
+
layout: intro
|
|
74
|
+
---
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### quote
|
|
78
|
+
|
|
79
|
+
Large quotation display.
|
|
80
|
+
```yaml
|
|
81
|
+
---
|
|
82
|
+
layout: quote
|
|
83
|
+
---
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### section
|
|
87
|
+
|
|
88
|
+
Section divider.
|
|
89
|
+
```yaml
|
|
90
|
+
---
|
|
91
|
+
layout: section
|
|
92
|
+
---
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### statement
|
|
96
|
+
|
|
97
|
+
Statement/affirmation display.
|
|
98
|
+
```yaml
|
|
99
|
+
---
|
|
100
|
+
layout: statement
|
|
101
|
+
---
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### fact
|
|
105
|
+
|
|
106
|
+
Fact/data display.
|
|
107
|
+
```yaml
|
|
108
|
+
---
|
|
109
|
+
layout: fact
|
|
110
|
+
---
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Multi-Column Layouts
|
|
114
|
+
|
|
115
|
+
### two-cols
|
|
116
|
+
|
|
117
|
+
Two columns side by side:
|
|
118
|
+
```md
|
|
119
|
+
---
|
|
120
|
+
layout: two-cols
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
# Left Column
|
|
124
|
+
|
|
125
|
+
Left content
|
|
126
|
+
|
|
127
|
+
::right::
|
|
128
|
+
|
|
129
|
+
# Right Column
|
|
130
|
+
|
|
131
|
+
Right content
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### two-cols-header
|
|
135
|
+
|
|
136
|
+
Header with two columns below:
|
|
137
|
+
```md
|
|
138
|
+
---
|
|
139
|
+
layout: two-cols-header
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
# Header
|
|
143
|
+
|
|
144
|
+
::left::
|
|
145
|
+
|
|
146
|
+
Left content
|
|
147
|
+
|
|
148
|
+
::right::
|
|
149
|
+
|
|
150
|
+
Right content
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Image Layouts
|
|
154
|
+
|
|
155
|
+
### image
|
|
156
|
+
|
|
157
|
+
Full-screen image:
|
|
158
|
+
```yaml
|
|
159
|
+
---
|
|
160
|
+
layout: image
|
|
161
|
+
image: /photo.jpg
|
|
162
|
+
backgroundSize: cover
|
|
163
|
+
---
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### image-left
|
|
167
|
+
|
|
168
|
+
Image on left, content on right:
|
|
169
|
+
```yaml
|
|
170
|
+
---
|
|
171
|
+
layout: image-left
|
|
172
|
+
image: /photo.jpg
|
|
173
|
+
class: my-class
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
# Content on Right
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### image-right
|
|
180
|
+
|
|
181
|
+
Image on right, content on left:
|
|
182
|
+
```yaml
|
|
183
|
+
---
|
|
184
|
+
layout: image-right
|
|
185
|
+
image: /photo.jpg
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
# Content on Left
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Props: `image`, `class`, `backgroundSize`
|
|
192
|
+
|
|
193
|
+
## Iframe Layouts
|
|
194
|
+
|
|
195
|
+
### iframe
|
|
196
|
+
|
|
197
|
+
Full-screen iframe:
|
|
198
|
+
```yaml
|
|
199
|
+
---
|
|
200
|
+
layout: iframe
|
|
201
|
+
url: https://example.com
|
|
202
|
+
---
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### iframe-left
|
|
206
|
+
|
|
207
|
+
Iframe on left, content on right:
|
|
208
|
+
```yaml
|
|
209
|
+
---
|
|
210
|
+
layout: iframe-left
|
|
211
|
+
url: https://example.com
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
# Content
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### iframe-right
|
|
218
|
+
|
|
219
|
+
Iframe on right, content on left:
|
|
220
|
+
```yaml
|
|
221
|
+
---
|
|
222
|
+
layout: iframe-right
|
|
223
|
+
url: https://example.com
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
# Content
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Layout Loading Order
|
|
230
|
+
|
|
231
|
+
1. Slidev default layouts
|
|
232
|
+
2. Theme layouts
|
|
233
|
+
3. Addon layouts
|
|
234
|
+
4. Custom layouts (`./layouts/`)
|
|
235
|
+
|
|
236
|
+
Later sources override earlier ones.
|
|
237
|
+
|
|
238
|
+
## Custom Layouts
|
|
239
|
+
|
|
240
|
+
Create `layouts/my-layout.vue`:
|
|
241
|
+
|
|
242
|
+
```vue
|
|
243
|
+
<template>
|
|
244
|
+
<div class="slidev-layout my-layout">
|
|
245
|
+
<slot />
|
|
246
|
+
</div>
|
|
247
|
+
</template>
|
|
248
|
+
|
|
249
|
+
<style scoped>
|
|
250
|
+
.my-layout {
|
|
251
|
+
display: flex;
|
|
252
|
+
align-items: center;
|
|
253
|
+
justify-content: center;
|
|
254
|
+
}
|
|
255
|
+
</style>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
With named slots:
|
|
259
|
+
|
|
260
|
+
```vue
|
|
261
|
+
<template>
|
|
262
|
+
<div class="slidev-layout two-areas">
|
|
263
|
+
<div class="top">
|
|
264
|
+
<slot name="top" />
|
|
265
|
+
</div>
|
|
266
|
+
<div class="bottom">
|
|
267
|
+
<slot />
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
</template>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Usage:
|
|
274
|
+
```md
|
|
275
|
+
---
|
|
276
|
+
layout: two-areas
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
::top::
|
|
280
|
+
|
|
281
|
+
Top content
|
|
282
|
+
|
|
283
|
+
::default::
|
|
284
|
+
|
|
285
|
+
Bottom content
|
|
286
|
+
```
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: syntax
|
|
3
|
+
description: Core Markdown syntax for Slidev presentations
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Slidev Markdown Syntax
|
|
7
|
+
|
|
8
|
+
Core Markdown syntax for Slidev presentations.
|
|
9
|
+
|
|
10
|
+
## Slide Separator
|
|
11
|
+
|
|
12
|
+
Use `---` with blank lines before and after:
|
|
13
|
+
|
|
14
|
+
```md
|
|
15
|
+
# Slide 1
|
|
16
|
+
|
|
17
|
+
Content
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Slide 2
|
|
22
|
+
|
|
23
|
+
More content
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Headmatter (Deck Config)
|
|
27
|
+
|
|
28
|
+
First frontmatter block configures the entire deck:
|
|
29
|
+
|
|
30
|
+
```md
|
|
31
|
+
---
|
|
32
|
+
theme: default
|
|
33
|
+
title: My Presentation
|
|
34
|
+
lineNumbers: true
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
# First Slide
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Per-Slide Frontmatter
|
|
41
|
+
|
|
42
|
+
Each slide can have its own frontmatter:
|
|
43
|
+
|
|
44
|
+
```md
|
|
45
|
+
---
|
|
46
|
+
layout: center
|
|
47
|
+
background: /image.jpg
|
|
48
|
+
class: text-white
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
# Centered Slide
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Presenter Notes
|
|
55
|
+
|
|
56
|
+
HTML comments at end of slide become presenter notes:
|
|
57
|
+
|
|
58
|
+
```md
|
|
59
|
+
# My Slide
|
|
60
|
+
|
|
61
|
+
Content here
|
|
62
|
+
|
|
63
|
+
<!--
|
|
64
|
+
These are presenter notes.
|
|
65
|
+
- Remember to mention X
|
|
66
|
+
- Demo the feature
|
|
67
|
+
-->
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Code Blocks
|
|
71
|
+
|
|
72
|
+
Standard Markdown with Shiki highlighting:
|
|
73
|
+
|
|
74
|
+
````md
|
|
75
|
+
```ts
|
|
76
|
+
const hello = 'world'
|
|
77
|
+
```
|
|
78
|
+
````
|
|
79
|
+
|
|
80
|
+
With features:
|
|
81
|
+
````md
|
|
82
|
+
```ts {2,3} // Line highlighting
|
|
83
|
+
```ts {1|2-3|all} // Click-based highlighting
|
|
84
|
+
```ts {monaco} // Monaco editor
|
|
85
|
+
```ts {monaco-run} // Runnable code
|
|
86
|
+
```ts twoslash // TypeScript types
|
|
87
|
+
```
|
|
88
|
+
````
|
|
89
|
+
|
|
90
|
+
## LaTeX Math
|
|
91
|
+
|
|
92
|
+
Inline: `$E = mc^2$`
|
|
93
|
+
|
|
94
|
+
Block:
|
|
95
|
+
```md
|
|
96
|
+
$$
|
|
97
|
+
\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
|
|
98
|
+
$$
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Diagrams
|
|
102
|
+
|
|
103
|
+
Mermaid:
|
|
104
|
+
````md
|
|
105
|
+
```mermaid
|
|
106
|
+
graph LR
|
|
107
|
+
A --> B --> C
|
|
108
|
+
```
|
|
109
|
+
````
|
|
110
|
+
|
|
111
|
+
PlantUML:
|
|
112
|
+
````md
|
|
113
|
+
```plantuml
|
|
114
|
+
@startuml
|
|
115
|
+
Alice -> Bob : Hello
|
|
116
|
+
@enduml
|
|
117
|
+
```
|
|
118
|
+
````
|
|
119
|
+
|
|
120
|
+
## MDC Syntax
|
|
121
|
+
|
|
122
|
+
Enable with `mdc: true`:
|
|
123
|
+
|
|
124
|
+
```md
|
|
125
|
+
[styled text]{style="color:red"}
|
|
126
|
+
{width=500px}
|
|
127
|
+
::component{prop="value"}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Scoped CSS
|
|
131
|
+
|
|
132
|
+
Styles apply only to current slide:
|
|
133
|
+
|
|
134
|
+
```md
|
|
135
|
+
# Red Title
|
|
136
|
+
|
|
137
|
+
<style>
|
|
138
|
+
h1 { color: red; }
|
|
139
|
+
</style>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Import Slides
|
|
143
|
+
|
|
144
|
+
```md
|
|
145
|
+
---
|
|
146
|
+
src: ./pages/intro.md
|
|
147
|
+
---
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Import specific slides:
|
|
151
|
+
```md
|
|
152
|
+
---
|
|
153
|
+
src: ./other.md#2,5-7
|
|
154
|
+
---
|
|
155
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: latex
|
|
3
|
+
description: Render mathematical equations using KaTeX
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# LaTeX
|
|
7
|
+
|
|
8
|
+
Render mathematical equations. Powered by KaTeX.
|
|
9
|
+
|
|
10
|
+
## Inline Math
|
|
11
|
+
|
|
12
|
+
```md
|
|
13
|
+
$\sqrt{3x-1}+(1+x)^2$
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Block Math
|
|
17
|
+
|
|
18
|
+
```md
|
|
19
|
+
$$
|
|
20
|
+
\begin{aligned}
|
|
21
|
+
\nabla \cdot \vec{E} &= \frac{\rho}{\varepsilon_0} \\
|
|
22
|
+
\nabla \cdot \vec{B} &= 0
|
|
23
|
+
\end{aligned}
|
|
24
|
+
$$
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Line Highlighting
|
|
28
|
+
|
|
29
|
+
```md
|
|
30
|
+
$$ {1|3|all}
|
|
31
|
+
\begin{aligned}
|
|
32
|
+
\nabla \cdot \vec{E} &= \frac{\rho}{\varepsilon_0} \\
|
|
33
|
+
\nabla \cdot \vec{B} &= 0 \\
|
|
34
|
+
\nabla \times \vec{E} &= -\frac{\partial\vec{B}}{\partial t}
|
|
35
|
+
\end{aligned}
|
|
36
|
+
$$
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Chemical Equations
|
|
40
|
+
|
|
41
|
+
Enable mhchem extension in `vite.config.ts`:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import 'katex/contrib/mhchem'
|
|
45
|
+
|
|
46
|
+
export default {}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Then use:
|
|
50
|
+
|
|
51
|
+
```md
|
|
52
|
+
$$
|
|
53
|
+
\ce{B(OH)3 + H2O <--> B(OH)4^- + H+}
|
|
54
|
+
$$
|
|
55
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mermaid
|
|
3
|
+
description: Create diagrams from text descriptions
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mermaid Diagrams
|
|
7
|
+
|
|
8
|
+
Create diagrams from text descriptions.
|
|
9
|
+
|
|
10
|
+
## Basic Usage
|
|
11
|
+
|
|
12
|
+
````md
|
|
13
|
+
```mermaid
|
|
14
|
+
sequenceDiagram
|
|
15
|
+
Alice->John: Hello John, how are you?
|
|
16
|
+
Note over Alice,John: A typical interaction
|
|
17
|
+
```
|
|
18
|
+
````
|
|
19
|
+
|
|
20
|
+
## With Options
|
|
21
|
+
|
|
22
|
+
````md
|
|
23
|
+
```mermaid {theme: 'neutral', scale: 0.8}
|
|
24
|
+
graph TD
|
|
25
|
+
B[Text] --> C{Decision}
|
|
26
|
+
C -->|One| D[Result 1]
|
|
27
|
+
C -->|Two| E[Result 2]
|
|
28
|
+
```
|
|
29
|
+
````
|
|
30
|
+
|
|
31
|
+
## Diagram Types
|
|
32
|
+
|
|
33
|
+
- `graph` / `flowchart` - Flow diagrams
|
|
34
|
+
- `sequenceDiagram` - Sequence diagrams
|
|
35
|
+
- `classDiagram` - Class diagrams
|
|
36
|
+
- `stateDiagram` - State diagrams
|
|
37
|
+
- `erDiagram` - Entity relationship
|
|
38
|
+
- `gantt` - Gantt charts
|
|
39
|
+
- `pie` - Pie charts
|
|
40
|
+
|
|
41
|
+
## Resources
|
|
42
|
+
|
|
43
|
+
- Mermaid docs: https://mermaid.js.org/
|
|
44
|
+
- Live editor: https://mermaid.live/
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plantuml
|
|
3
|
+
description: Create UML diagrams from text descriptions
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PlantUML Diagrams
|
|
7
|
+
|
|
8
|
+
Create UML diagrams from text descriptions.
|
|
9
|
+
|
|
10
|
+
## Basic Usage
|
|
11
|
+
|
|
12
|
+
````md
|
|
13
|
+
```plantuml
|
|
14
|
+
@startuml
|
|
15
|
+
Alice -> Bob : Hello!
|
|
16
|
+
@enduml
|
|
17
|
+
```
|
|
18
|
+
````
|
|
19
|
+
|
|
20
|
+
## Server Configuration
|
|
21
|
+
|
|
22
|
+
Default: Uses https://www.plantuml.com/plantuml
|
|
23
|
+
|
|
24
|
+
Custom server in headmatter:
|
|
25
|
+
|
|
26
|
+
```md
|
|
27
|
+
---
|
|
28
|
+
plantUmlServer: https://your-server.com/plantuml
|
|
29
|
+
---
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Diagram Types
|
|
33
|
+
|
|
34
|
+
- Sequence diagrams
|
|
35
|
+
- Class diagrams
|
|
36
|
+
- Activity diagrams
|
|
37
|
+
- Component diagrams
|
|
38
|
+
- State diagrams
|
|
39
|
+
- Object diagrams
|
|
40
|
+
- Use case diagrams
|
|
41
|
+
|
|
42
|
+
## Resources
|
|
43
|
+
|
|
44
|
+
- PlantUML docs: https://plantuml.com/
|
|
45
|
+
- Live editor: https://plantuml.com/plantuml
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monaco-run
|
|
3
|
+
description: Run code directly in the editor and see results
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Monaco Runner
|
|
7
|
+
|
|
8
|
+
Run code directly in the editor and see results.
|
|
9
|
+
|
|
10
|
+
## Basic Usage
|
|
11
|
+
|
|
12
|
+
````md
|
|
13
|
+
```ts {monaco-run}
|
|
14
|
+
function distance(x: number, y: number) {
|
|
15
|
+
return Math.sqrt(x ** 2 + y ** 2)
|
|
16
|
+
}
|
|
17
|
+
console.log(distance(3, 4))
|
|
18
|
+
```
|
|
19
|
+
````
|
|
20
|
+
|
|
21
|
+
Shows a "Run" button and displays output below the code.
|
|
22
|
+
|
|
23
|
+
## Disable Auto-run
|
|
24
|
+
|
|
25
|
+
````md
|
|
26
|
+
```ts {monaco-run} {autorun:false}
|
|
27
|
+
console.log('Click the play button to run me')
|
|
28
|
+
```
|
|
29
|
+
````
|
|
30
|
+
|
|
31
|
+
## Show Output on Click
|
|
32
|
+
|
|
33
|
+
````md
|
|
34
|
+
```ts {monaco-run} {showOutputAt:'+1'}
|
|
35
|
+
console.log('Shown after 1 click')
|
|
36
|
+
```
|
|
37
|
+
````
|
|
38
|
+
|
|
39
|
+
## Supported Languages
|
|
40
|
+
|
|
41
|
+
- JavaScript
|
|
42
|
+
- TypeScript
|
|
43
|
+
|
|
44
|
+
For other languages, configure custom code runners in `/custom/config-code-runners`.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monaco-write
|
|
3
|
+
description: Edit code and save changes back to the file
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Writable Monaco Editor
|
|
7
|
+
|
|
8
|
+
Edit code and save changes back to the file.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```md
|
|
13
|
+
<<< ./some-file.ts {monaco-write}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Behavior
|
|
17
|
+
|
|
18
|
+
- Links Monaco editor to actual file on filesystem
|
|
19
|
+
- Changes are saved directly to the file
|
|
20
|
+
- Useful for live coding demonstrations
|
|
21
|
+
|
|
22
|
+
## Warning
|
|
23
|
+
|
|
24
|
+
Back up files before using - changes are saved directly.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monaco
|
|
3
|
+
description: Turn code blocks into fully-featured editors
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Monaco Editor
|
|
7
|
+
|
|
8
|
+
Turn code blocks into fully-featured editors.
|
|
9
|
+
|
|
10
|
+
## Basic Usage
|
|
11
|
+
|
|
12
|
+
````md
|
|
13
|
+
```ts {monaco}
|
|
14
|
+
console.log('HelloWorld')
|
|
15
|
+
```
|
|
16
|
+
````
|
|
17
|
+
|
|
18
|
+
## Diff Editor
|
|
19
|
+
|
|
20
|
+
Compare two code versions:
|
|
21
|
+
|
|
22
|
+
````md
|
|
23
|
+
```ts {monaco-diff}
|
|
24
|
+
console.log('Original text')
|
|
25
|
+
~~~
|
|
26
|
+
console.log('Modified text')
|
|
27
|
+
```
|
|
28
|
+
````
|
|
29
|
+
|
|
30
|
+
## Editor Height
|
|
31
|
+
|
|
32
|
+
Auto-grow as you type:
|
|
33
|
+
|
|
34
|
+
````md
|
|
35
|
+
```ts {monaco} {height:'auto'}
|
|
36
|
+
console.log('Hello, World!')
|
|
37
|
+
```
|
|
38
|
+
````
|
|
39
|
+
|
|
40
|
+
Fixed height:
|
|
41
|
+
|
|
42
|
+
````md
|
|
43
|
+
```ts {monaco} {height:'300px'}
|
|
44
|
+
// code here
|
|
45
|
+
```
|
|
46
|
+
````
|
|
47
|
+
|
|
48
|
+
## Configuration
|
|
49
|
+
|
|
50
|
+
See `/custom/config-monaco` for Monaco editor customization options.
|