@ncukondo/slide-generation 0.1.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,56 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2024-03-15
9
+
10
+ ### Added
11
+
12
+ #### Core Features
13
+ - YAML-based source file format for presentations
14
+ - Template system with Nunjucks engine
15
+ - Zod-based schema validation for templates
16
+ - Pipeline architecture (Parser -> Transformer -> Renderer)
17
+
18
+ #### Templates
19
+ - **Basic templates**: title, section, bullet-list, numbered-list
20
+ - **Diagram templates**: flow-chart, cycle-diagram, hierarchy, matrix, timeline
21
+ - **Data templates**: table, comparison-table
22
+ - **Layout templates**: two-column, three-column, image-text, gallery
23
+ - **Special templates**: quote, code-block, bibliography, custom
24
+
25
+ #### CLI Commands
26
+ - `convert` - Convert YAML source to Marp Markdown
27
+ - `validate` - Validate source files
28
+ - `watch` - Watch files for changes and auto-convert
29
+ - `preview` - Preview with Marp CLI
30
+ - `templates list/info/example` - Template management
31
+ - `icons list/search/preview` - Icon management
32
+ - `init` - Initialize new project
33
+
34
+ #### Icon System
35
+ - Icon registry with aliases
36
+ - Support for Material Icons and Heroicons (CDN)
37
+ - Custom icon support
38
+ - Icon caching with TTL
39
+
40
+ #### Reference System
41
+ - Integration with reference-manager CLI
42
+ - Citation key extraction from YAML
43
+ - Multiple citation styles support
44
+ - Fallback handling when reference-manager unavailable
45
+
46
+ #### Documentation
47
+ - README with installation and usage instructions
48
+ - Example presentations (basic, academic, corporate)
49
+ - Specification documents in `spec/` directory
50
+
51
+ ### Technical Details
52
+ - TypeScript with strict mode
53
+ - ESM modules
54
+ - Node.js >= 22.0.0 requirement
55
+ - Vitest for testing (500+ tests)
56
+ - oxlint for linting
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Takeshi Kondo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,248 @@
1
+ # slide-generation
2
+
3
+ A CLI tool to generate Marp-compatible Markdown from YAML source files, designed for both humans and AI to create presentations easily.
4
+
5
+ ## Features
6
+
7
+ - **YAML-based source files** - Structured, readable, and easy to generate programmatically
8
+ - **Template system** - Reusable templates for various slide types
9
+ - **Icon support** - Built-in icon registry with Material Icons, Heroicons, and custom icons
10
+ - **Reference management** - Integration with reference-manager CLI for citations
11
+ - **Watch mode** - Auto-convert on file changes
12
+ - **Marp compatible** - Output works directly with Marp CLI
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ # Using npm
18
+ npm install -g @ncukondo/slide-generation
19
+
20
+ # Using pnpm
21
+ pnpm add -g @ncukondo/slide-generation
22
+
23
+ # Or run directly with npx
24
+ npx @ncukondo/slide-generation convert presentation.yaml
25
+ ```
26
+
27
+ **Requirements:** Node.js >= 22.0.0
28
+
29
+ ## Quick Start
30
+
31
+ ```bash
32
+ # Initialize a new project
33
+ slide-gen init my-presentation
34
+ cd my-presentation
35
+
36
+ # Edit presentation.yaml, then convert
37
+ slide-gen convert presentation.yaml
38
+
39
+ # Watch for changes
40
+ slide-gen watch presentation.yaml
41
+
42
+ # Preview with Marp CLI
43
+ marp --preview presentation.md
44
+ ```
45
+
46
+ ## Source File Format
47
+
48
+ ```yaml
49
+ meta:
50
+ title: My Presentation
51
+ author: Your Name
52
+ date: "2024-03-15"
53
+ theme: default
54
+
55
+ slides:
56
+ - template: title
57
+ content:
58
+ title: Welcome
59
+ subtitle: Getting Started
60
+ author: Your Name
61
+
62
+ - template: bullet-list
63
+ content:
64
+ title: Key Points
65
+ items:
66
+ - First important point
67
+ - Second important point
68
+ - Third important point
69
+
70
+ - template: section
71
+ content:
72
+ title: Next Section
73
+ ```
74
+
75
+ ## Commands
76
+
77
+ ### convert
78
+
79
+ Convert YAML source to Marp Markdown.
80
+
81
+ ```bash
82
+ slide-gen convert <input> [options]
83
+ ```
84
+
85
+ Options:
86
+ - `-o, --output <path>` - Output file path (default: `<input>.md`)
87
+ - `-c, --config <path>` - Config file path
88
+ - `-t, --theme <name>` - Theme name
89
+ - `--no-references` - Disable reference processing
90
+ - `-v, --verbose` - Verbose output
91
+
92
+ ### validate
93
+
94
+ Validate source file without conversion.
95
+
96
+ ```bash
97
+ slide-gen validate <input> [options]
98
+ ```
99
+
100
+ Options:
101
+ - `--strict` - Treat warnings as errors
102
+ - `--format <fmt>` - Output format (text/json)
103
+
104
+ ### watch
105
+
106
+ Watch file and auto-convert on changes.
107
+
108
+ ```bash
109
+ slide-gen watch <input> [options]
110
+ ```
111
+
112
+ Options:
113
+ - `-o, --output <path>` - Output file path
114
+ - `--debounce <ms>` - Debounce delay (default: 300)
115
+
116
+ ### templates
117
+
118
+ List and inspect available templates.
119
+
120
+ ```bash
121
+ # List all templates
122
+ slide-gen templates list
123
+
124
+ # Show template details
125
+ slide-gen templates info <name>
126
+
127
+ # Export example YAML
128
+ slide-gen templates example <name>
129
+ ```
130
+
131
+ ### icons
132
+
133
+ Search and preview icons.
134
+
135
+ ```bash
136
+ # List icon sources
137
+ slide-gen icons list
138
+
139
+ # Search icons
140
+ slide-gen icons search <query>
141
+
142
+ # Preview icon
143
+ slide-gen icons preview <name>
144
+ ```
145
+
146
+ ### init
147
+
148
+ Initialize a new project.
149
+
150
+ ```bash
151
+ slide-gen init [directory]
152
+ ```
153
+
154
+ ### preview
155
+
156
+ Preview with Marp CLI (requires @marp-team/marp-cli).
157
+
158
+ ```bash
159
+ slide-gen preview <input> [options]
160
+ ```
161
+
162
+ ## Available Templates
163
+
164
+ ### Basic
165
+ - `title` - Title slide
166
+ - `section` - Section divider
167
+ - `bullet-list` - Bullet point list
168
+ - `numbered-list` - Numbered list
169
+
170
+ ### Diagrams
171
+ - `flow-chart` - Flow chart
172
+ - `cycle-diagram` - Cycle diagram (3-6 elements)
173
+ - `hierarchy` - Hierarchy/org chart
174
+ - `matrix` - 2x2 matrix
175
+ - `timeline` - Timeline
176
+
177
+ ### Data
178
+ - `table` - Basic table
179
+ - `comparison-table` - Comparison table with highlighting
180
+
181
+ ### Layouts
182
+ - `two-column` - Two column layout
183
+ - `three-column` - Three column layout
184
+ - `image-text` - Image with text
185
+ - `gallery` - Image gallery
186
+
187
+ ### Special
188
+ - `quote` - Quote/citation slide
189
+ - `code-block` - Code block with syntax highlighting
190
+ - `bibliography` - Bibliography/references slide
191
+ - `custom` - Custom Markdown slide
192
+
193
+ ## Configuration
194
+
195
+ Create `config.yaml` in your project:
196
+
197
+ ```yaml
198
+ templates:
199
+ builtin: "./templates"
200
+ custom: "./my-templates"
201
+
202
+ icons:
203
+ registry: "./icons/registry.yaml"
204
+ cache:
205
+ enabled: true
206
+ ttl: 86400
207
+
208
+ references:
209
+ enabled: true
210
+ connection:
211
+ type: cli
212
+ command: "ref"
213
+
214
+ output:
215
+ theme: "default"
216
+ ```
217
+
218
+ Config file search order:
219
+ 1. `--config` option
220
+ 2. `./config.yaml`
221
+ 3. `./slide-gen.yaml`
222
+ 4. `~/.slide-gen/config.yaml`
223
+
224
+ ## Development
225
+
226
+ ```bash
227
+ # Install dependencies
228
+ pnpm install
229
+
230
+ # Development mode
231
+ pnpm dev
232
+
233
+ # Build
234
+ pnpm build
235
+
236
+ # Test
237
+ pnpm test
238
+
239
+ # Lint
240
+ pnpm lint
241
+
242
+ # Type check
243
+ pnpm typecheck
244
+ ```
245
+
246
+ ## License
247
+
248
+ MIT
package/README_ja.md ADDED
@@ -0,0 +1,248 @@
1
+ # slide-generation
2
+
3
+ YAMLソースファイルからMarp対応Markdownを生成するCLIツールです。人間とAIの両方がプレゼンテーションを簡単に作成できるように設計されています。
4
+
5
+ ## 特徴
6
+
7
+ - **YAMLベースのソースファイル** - 構造化され、可読性が高く、プログラムからの生成も容易
8
+ - **テンプレートシステム** - 様々なスライドタイプに対応した再利用可能なテンプレート
9
+ - **アイコンサポート** - Material Icons、Heroicons、カスタムアイコンに対応した組み込みアイコンレジストリ
10
+ - **文献管理連携** - reference-manager CLIとの連携による引用管理
11
+ - **監視モード** - ファイル変更時の自動変換
12
+ - **Marp互換** - 出力はMarp CLIでそのまま使用可能
13
+
14
+ ## インストール
15
+
16
+ ```bash
17
+ # npmを使用
18
+ npm install -g @ncukondo/slide-generation
19
+
20
+ # pnpmを使用
21
+ pnpm add -g @ncukondo/slide-generation
22
+
23
+ # npxで直接実行
24
+ npx @ncukondo/slide-generation convert presentation.yaml
25
+ ```
26
+
27
+ **動作要件:** Node.js >= 22.0.0
28
+
29
+ ## クイックスタート
30
+
31
+ ```bash
32
+ # 新規プロジェクトを初期化
33
+ slide-gen init my-presentation
34
+ cd my-presentation
35
+
36
+ # presentation.yamlを編集後、変換
37
+ slide-gen convert presentation.yaml
38
+
39
+ # ファイル変更を監視
40
+ slide-gen watch presentation.yaml
41
+
42
+ # Marp CLIでプレビュー
43
+ marp --preview presentation.md
44
+ ```
45
+
46
+ ## ソースファイル形式
47
+
48
+ ```yaml
49
+ meta:
50
+ title: プレゼンテーション
51
+ author: 作成者名
52
+ date: "2024-03-15"
53
+ theme: default
54
+
55
+ slides:
56
+ - template: title
57
+ content:
58
+ title: ようこそ
59
+ subtitle: はじめに
60
+ author: 作成者名
61
+
62
+ - template: bullet-list
63
+ content:
64
+ title: 重要なポイント
65
+ items:
66
+ - 第一のポイント
67
+ - 第二のポイント
68
+ - 第三のポイント
69
+
70
+ - template: section
71
+ content:
72
+ title: 次のセクション
73
+ ```
74
+
75
+ ## コマンド
76
+
77
+ ### convert
78
+
79
+ YAMLソースをMarp Markdownに変換します。
80
+
81
+ ```bash
82
+ slide-gen convert <input> [options]
83
+ ```
84
+
85
+ オプション:
86
+ - `-o, --output <path>` - 出力ファイルパス(デフォルト: `<input>.md`)
87
+ - `-c, --config <path>` - 設定ファイルパス
88
+ - `-t, --theme <name>` - テーマ名
89
+ - `--no-references` - 引用処理を無効化
90
+ - `-v, --verbose` - 詳細出力
91
+
92
+ ### validate
93
+
94
+ 変換せずにソースファイルを検証します。
95
+
96
+ ```bash
97
+ slide-gen validate <input> [options]
98
+ ```
99
+
100
+ オプション:
101
+ - `--strict` - 警告もエラーとして扱う
102
+ - `--format <fmt>` - 出力形式(text/json)
103
+
104
+ ### watch
105
+
106
+ ファイルを監視して変更時に自動変換します。
107
+
108
+ ```bash
109
+ slide-gen watch <input> [options]
110
+ ```
111
+
112
+ オプション:
113
+ - `-o, --output <path>` - 出力ファイルパス
114
+ - `--debounce <ms>` - デバウンス遅延(デフォルト: 300)
115
+
116
+ ### templates
117
+
118
+ 利用可能なテンプレートの一覧表示と詳細確認を行います。
119
+
120
+ ```bash
121
+ # 全テンプレートを一覧表示
122
+ slide-gen templates list
123
+
124
+ # テンプレートの詳細を表示
125
+ slide-gen templates info <name>
126
+
127
+ # サンプルYAMLを出力
128
+ slide-gen templates example <name>
129
+ ```
130
+
131
+ ### icons
132
+
133
+ アイコンの検索とプレビューを行います。
134
+
135
+ ```bash
136
+ # アイコンソースを一覧表示
137
+ slide-gen icons list
138
+
139
+ # アイコンを検索
140
+ slide-gen icons search <query>
141
+
142
+ # アイコンをプレビュー
143
+ slide-gen icons preview <name>
144
+ ```
145
+
146
+ ### init
147
+
148
+ 新規プロジェクトを初期化します。
149
+
150
+ ```bash
151
+ slide-gen init [directory]
152
+ ```
153
+
154
+ ### preview
155
+
156
+ Marp CLIでプレビューを表示します(@marp-team/marp-cliが必要)。
157
+
158
+ ```bash
159
+ slide-gen preview <input> [options]
160
+ ```
161
+
162
+ ## 利用可能なテンプレート
163
+
164
+ ### 基本(Basic)
165
+ - `title` - タイトルスライド
166
+ - `section` - セクション区切り
167
+ - `bullet-list` - 箇条書きリスト
168
+ - `numbered-list` - 番号付きリスト
169
+
170
+ ### 図表(Diagrams)
171
+ - `flow-chart` - フローチャート
172
+ - `cycle-diagram` - 循環図(3〜6要素)
173
+ - `hierarchy` - 階層図・組織図
174
+ - `matrix` - 2x2マトリクス
175
+ - `timeline` - タイムライン
176
+
177
+ ### データ(Data)
178
+ - `table` - 基本テーブル
179
+ - `comparison-table` - 比較表(強調表示付き)
180
+
181
+ ### レイアウト(Layouts)
182
+ - `two-column` - 2カラムレイアウト
183
+ - `three-column` - 3カラムレイアウト
184
+ - `image-text` - 画像とテキスト
185
+ - `gallery` - 画像ギャラリー
186
+
187
+ ### 特殊(Special)
188
+ - `quote` - 引用スライド
189
+ - `code-block` - コードブロック(シンタックスハイライト付き)
190
+ - `bibliography` - 参考文献スライド
191
+ - `custom` - カスタムMarkdownスライド
192
+
193
+ ## 設定
194
+
195
+ プロジェクトに `config.yaml` を作成します:
196
+
197
+ ```yaml
198
+ templates:
199
+ builtin: "./templates"
200
+ custom: "./my-templates"
201
+
202
+ icons:
203
+ registry: "./icons/registry.yaml"
204
+ cache:
205
+ enabled: true
206
+ ttl: 86400
207
+
208
+ references:
209
+ enabled: true
210
+ connection:
211
+ type: cli
212
+ command: "ref"
213
+
214
+ output:
215
+ theme: "default"
216
+ ```
217
+
218
+ 設定ファイルの検索順序:
219
+ 1. `--config` オプションで指定されたパス
220
+ 2. `./config.yaml`
221
+ 3. `./slide-gen.yaml`
222
+ 4. `~/.slide-gen/config.yaml`
223
+
224
+ ## 開発
225
+
226
+ ```bash
227
+ # 依存パッケージをインストール
228
+ pnpm install
229
+
230
+ # 開発モード
231
+ pnpm dev
232
+
233
+ # ビルド
234
+ pnpm build
235
+
236
+ # テスト
237
+ pnpm test
238
+
239
+ # リント
240
+ pnpm lint
241
+
242
+ # 型チェック
243
+ pnpm typecheck
244
+ ```
245
+
246
+ ## ライセンス
247
+
248
+ MIT
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node