slidev-theme-kotlin 0.0.8 → 0.10.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,42 @@
1
+ # Changelog
2
+
3
+ ## 0.10.0
4
+
5
+ ### Added
6
+
7
+ - Bundle `DrawnAnnotation`, a click-aware, Rough.js-powered annotation component for marking elements or exact code text with circles, underlines, boxes, and strike-throughs.
8
+ - Support leader lines, target marks, automatic non-overlapping labels, sequential nested reveals, temporary click ranges, and Magic Move-aware tracking.
9
+ - Add complete component documentation and interactive examples to the theme showcase.
10
+
11
+ ### Packaging
12
+
13
+ - Add `roughjs` as a runtime dependency required by `DrawnAnnotation`.
14
+
15
+ ## 0.0.10
16
+
17
+ ### Added
18
+
19
+ - Allow decks to enable Kodee once with `themeConfig.kodee`. A shared per-slide layer supports every layout: regular slides use a small bottom-right mascot, while cover and intro layouts use a large featured mascot.
20
+ - Support concise per-slide overrides such as `kodee: wink` and `kodee: false`, while retaining the full object configuration.
21
+ - Implement the documented `medium` Kodee size.
22
+ - Bundle `DrawnAnnotation`, a click-aware, Rough.js-powered annotation component for marking elements or exact code text with circles, underlines, boxes, and strike-throughs.
23
+ - Support leader lines, target marks, automatic non-overlapping labels, sequential nested reveals, temporary click ranges, and Magic Move-aware tracking.
24
+ - Add complete component documentation and interactive examples to the theme showcase.
25
+
26
+ ### Packaging
27
+
28
+ - Add `roughjs` as a runtime dependency required by `DrawnAnnotation`.
29
+
30
+ ## 0.0.9
31
+
32
+ ### Fixed
33
+
34
+ - Bundle Kodee SVG variants with the theme instead of serving them from the theme package's `public/` directory.
35
+
36
+ Previously, `Kodee.vue` generated runtime URLs such as `/theme/kodee-welcome.svg` and relied on Slidev to copy a consuming theme's `public/` directory into the presentation output. That copying behavior did not work with newer Slidev/Vite versions (including Slidev 52.19 and Vite 8), so consumer builds omitted `dist/theme/kodee-*.svg`; Kodee images then returned 404s in the browser.
37
+
38
+ Kodee assets now live in `assets/` and are imported by Vite at build time. Consumer presentations receive emitted, fingerprinted asset URLs, independent of Slidev's theme-public-directory copying behavior.
39
+
40
+ ### Packaging
41
+
42
+ - Added an npm `files` allowlist so the bundled mascot assets are always included in the published theme package.
package/README.md CHANGED
@@ -12,6 +12,7 @@ This theme provides a professional presentation template tailored for Kotlin dev
12
12
  - **Multiple Layouts**: Pre-built layouts including default, cover, and intro
13
13
  - **Kotlin Branding**: Official Kotlin logos for both light and dark modes
14
14
  - **JetBrains Fonts**: Uses Inter for sans-serif and JetBrains Mono for code
15
+ - **Drawn annotations**: Click-aware, hand-drawn marks, labels, and connectors for elements and code
15
16
 
16
17
  ## Requirements
17
18
 
@@ -43,7 +44,25 @@ transition: view-transition
43
44
 
44
45
  ### Using Kodee Mascot
45
46
 
46
- Add Kodee to any slide by including the `kodee` configuration in the slide's frontmatter:
47
+ Enable Kodee once for the whole deck with `themeConfig`:
48
+
49
+ ```yaml
50
+ ---
51
+ theme: kotlin
52
+ themeConfig:
53
+ kodee: greeting
54
+ ---
55
+ ```
56
+
57
+ Kodee then uses layout-aware defaults: `small` in the bottom-right corner on regular slides, and `large`/`featured` on `cover` and `intro` slides. Override only the variant when a slide needs a different expression:
58
+
59
+ ```yaml
60
+ ---
61
+ kodee: wink
62
+ ---
63
+ ```
64
+
65
+ Use `kodee: false` to hide the mascot on one slide. The original object form remains available when you need complete control:
47
66
 
48
67
  ```yaml
49
68
  ---
@@ -52,8 +71,6 @@ kodee:
52
71
  size: large
53
72
  position: featured
54
73
  ---
55
-
56
- # Your Slide Content
57
74
  ```
58
75
 
59
76
  #### Kodee Configuration Options
@@ -72,13 +89,13 @@ kodee:
72
89
  - `tiny` - Tiny Kodee
73
90
 
74
91
  - **size**: Control Kodee's size
75
- - `small` - 200x200px (default)
76
- - `large` - 600x600px (500x500px for wave variant)
77
- - `medium` - TODO: Not yet implemented
92
+ - `small` - 200x200px (regular-layout default)
93
+ - `medium` - 320x320px
94
+ - `large` - 600x600px (500x500px for wave variant; cover/intro default)
78
95
 
79
96
  - **position**: Control Kodee's placement
80
- - `corner` - Bottom right corner (default)
81
- - `featured` - Prominently displayed on slide
97
+ - `corner` - Bottom right corner (regular-layout default)
98
+ - `featured` - Prominently displayed (cover/intro default)
82
99
  - `custom` - Use with `x` and `y` coordinates
83
100
 
84
101
  #### Custom Positioning
@@ -96,6 +113,42 @@ kodee:
96
113
  ---
97
114
  ```
98
115
 
116
+ ### Using DrawnAnnotation
117
+
118
+ `<DrawnAnnotation>` is auto-registered for every deck using the theme. It can mark an element with a selector or exact text inside a Shiki or Magic Move code block, then connect that mark to a label or another element.
119
+
120
+ ````md
121
+ <DrawnAnnotation type="circle" text="fun main" label="program entry point" :on="1">
122
+
123
+ ```kotlin
124
+ fun main() = println("Hello, Kotlin!")
125
+ ```
126
+
127
+ </DrawnAnnotation>
128
+ ````
129
+
130
+ The full prop reference, timing behavior, and troubleshooting guide are in [`components/README.md`](components/README.md). The bundled [`slides.md`](slides.md) includes working examples of code annotations, connectors, labels, sequential reveals, and Magic Move integration.
131
+
132
+ #### IntelliJ formatting
133
+
134
+ IntelliJ recognizes only the first YAML block in a Markdown file as frontmatter. To keep later Slidev frontmatter intact when using **Reformat Code**, enable formatter tags and stop formatting after the deck headmatter:
135
+
136
+ ```ini
137
+ # .editorconfig
138
+ [*.md]
139
+ ij_formatter_tags_enabled = true
140
+ ```
141
+
142
+ ```md
143
+ ---
144
+ theme: kotlin
145
+ ---
146
+
147
+ <!-- @formatter:off -->
148
+ ```
149
+
150
+ The theme's example deck includes this guard.
151
+
99
152
  ## Development
100
153
 
101
154
  ### Available Scripts
@@ -114,9 +167,9 @@ npm run export
114
167
  npm run screenshot
115
168
  ```
116
169
 
117
- ### Running the Example
170
+ ### Running the Slides
118
171
 
119
- The repository includes `example.md` demonstrating all theme features:
172
+ The repository includes `slides.md`, a compact presentation demonstrating the theme's layouts, Kotlin highlighting, Kodee animations, magic moves, and click animations:
120
173
 
121
174
  ```bash
122
175
  npm run dev
@@ -131,12 +184,14 @@ This will open the example presentation in your browser with hot-reload enabled.
131
184
  ├── components/ # Vue components
132
185
  │ ├── Kodee.vue # Main Kodee mascot component with animations
133
186
  │ └── KodeeWrapper.vue # Wrapper component for Kodee integration
187
+ ├── slide-bottom.vue # Per-slide Kodee layer shared by every layout
134
188
  ├── layouts/ # Slidev layout templates
135
189
  │ ├── cover.vue # Cover slide layout
136
190
  │ ├── default.vue # Default slide layout
137
191
  │ └── intro.vue # Introduction slide layout
192
+ ├── assets/ # Bundled theme assets
193
+ │ └── kodee-*.svg # Kodee mascot variants (11 variants)
138
194
  ├── public/ # Static assets
139
- │ ├── kodee-*.svg # Kodee mascot variants (11 variants)
140
195
  │ └── kotlin-logo*.svg # Kotlin logos (light/dark modes)
141
196
  ├── setup/ # Slidev setup files
142
197
  │ └── shiki.ts # Syntax highlighting configuration for Kotlin
@@ -144,7 +199,7 @@ This will open the example presentation in your browser with hot-reload enabled.
144
199
  │ ├── index.ts # Style entry point
145
200
  │ └── layout.css # Layout styles
146
201
  ├── debug.js # Utility script for enumerating Shiki Kotlin tokens
147
- ├── example.md # Example presentation demonstrating theme features
202
+ ├── slides.md # Example presentation used for local development and GitHub Pages
148
203
  ├── package.json # Package configuration and dependencies
149
204
  └── LICENSE # Apache License 2.0
150
205
  ```
@@ -203,6 +258,7 @@ layout: cover
203
258
 
204
259
  ### Runtime Dependencies
205
260
  - `@slidev/types` (^52.2.5) - Slidev type definitions
261
+ - `roughjs` (^4.6.6) - Hand-drawn SVG paths for `DrawnAnnotation`
206
262
 
207
263
  ### Development Dependencies
208
264
  - `@slidev/cli` (^52.2.5) - Slidev command-line interface