create-slidev 0.36.6 → 0.36.8

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/build.mjs ADDED
@@ -0,0 +1,33 @@
1
+ import { copyFileSync, existsSync, mkdirSync, rmSync } from 'node:fs'
2
+ import * as url from 'node:url'
3
+ import { resolve } from 'node:path'
4
+
5
+ const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
6
+ const __templateDir = resolve(__dirname, 'template')
7
+ const __pagesDir = resolve(__templateDir, 'pages')
8
+
9
+ const shouldCreatePagesDict = () => !existsSync(__pagesDir)
10
+
11
+ // key: copy to (relative ./)
12
+ // value: origin (relative ./template)
13
+ const needCopyFiles = {
14
+ 'slides.md': '../../../demo/starter/slides.md',
15
+ 'pages/multiple-entries.md': '../../../demo/starter/pages/multiple-entries.md',
16
+ }
17
+
18
+ function main() {
19
+ if (shouldCreatePagesDict())
20
+ mkdirSync(__pagesDir)
21
+ Object.keys(needCopyFiles).forEach((relativeTargetPath) => {
22
+ const sourcePath = resolve(__templateDir, needCopyFiles[relativeTargetPath])
23
+ const targetPath = resolve(__templateDir, relativeTargetPath)
24
+ const exist = existsSync(targetPath)
25
+ if (exist)
26
+ rmSync(targetPath)
27
+ copyFileSync(sourcePath, targetPath)
28
+ })
29
+ // eslint-disable-next-line no-console
30
+ console.log('done...')
31
+ }
32
+
33
+ main()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-slidev",
3
- "version": "0.36.6",
3
+ "version": "0.36.8",
4
4
  "description": "Create starter template for Slidev",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -21,10 +21,10 @@
21
21
  "dependencies": {
22
22
  "execa": "^5.1.1",
23
23
  "kolorist": "^1.6.0",
24
- "minimist": "^1.2.6",
24
+ "minimist": "^1.2.7",
25
25
  "prompts": "^2.4.2"
26
26
  },
27
27
  "scripts": {
28
- "build": "cp ../../demo/starter/slides.md template/slides.md"
28
+ "build": "node build.mjs"
29
29
  }
30
30
  }
@@ -7,7 +7,7 @@
7
7
  "export": "slidev export"
8
8
  },
9
9
  "dependencies": {
10
- "@slidev/cli": "^0.36.6",
10
+ "@slidev/cli": "^0.36.8",
11
11
  "@slidev/theme-default": "*",
12
12
  "@slidev/theme-seriph": "*"
13
13
  }
@@ -0,0 +1,27 @@
1
+ # Multiple Entries
2
+
3
+ You can split your slides.md into multiple files and organize them as you want using the `src` attribute.
4
+
5
+ #### `slides.md`
6
+
7
+ ```markdown
8
+ # Page 1
9
+
10
+ Page 2 from main entry.
11
+
12
+ ---
13
+ src: ./subpage.md
14
+ ---
15
+ ```
16
+
17
+ <br>
18
+
19
+ #### `subpage.md`
20
+
21
+ ```markdown
22
+ # Page 2
23
+
24
+ Page 2 from another file.
25
+ ```
26
+
27
+ [Learn more](https://sli.dev/guide/syntax.html#multiple-entries)
@@ -83,6 +83,10 @@ h1 {
83
83
  }
84
84
  </style>
85
85
 
86
+ <!--
87
+ Here is another comment.
88
+ -->
89
+
86
90
  ---
87
91
 
88
92
  # Navigation
@@ -178,6 +182,16 @@ Check out [the guides](https://sli.dev/builtin/components.html) for more.
178
182
  </div>
179
183
  </div>
180
184
 
185
+ <!--
186
+ Presenter note with **bold**, *italic*, and ~~striked~~ text.
187
+
188
+ Also, HTML elements are valid:
189
+ <div class="flex w-full">
190
+ <span style="flex-grow: 1;">Left content</span>
191
+ <span>Right content</span>
192
+ </div>
193
+ -->
194
+
181
195
 
182
196
  ---
183
197
  class: px-20
@@ -1,5 +1,7 @@
1
1
  {
2
2
  "rewrites": [
3
3
  { "source": "/(.*)", "destination": "/index.html" }
4
- ]
4
+ ],
5
+ "buildCommand": "npm run build",
6
+ "outputDirectory": "dist"
5
7
  }