@compiiile/compiiile 2.11.0 → 2.12.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/.compiiile/.astro/settings.json +1 -1
- package/README.md +1 -0
- package/bin/config.js +17 -13
- package/bin/vitePluginCompiiile/models/Context.js +9 -1
- package/dist/style.css +1 -1
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -183,6 +183,7 @@ Other frontmatter keys are handled:
|
|
|
183
183
|
- `textAlign`: possible values
|
|
184
184
|
are [CSS text-align values](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) (`left`, `center`, ...). This
|
|
185
185
|
changes the default text alignment in slides. The default value is `center`.
|
|
186
|
+
- `ignore` : Boolean value (`true` or `false`) to ignore the current file and exclude it from Compiiile (the file is not ignored by default).
|
|
186
187
|
|
|
187
188
|
> :bulb: You can override slides theme by passing it to a `theme` query parameter in your slide url (for example `/s/slides?theme=light`). See the `theme` config parameter below for valid values.
|
|
188
189
|
|
package/bin/config.js
CHANGED
|
@@ -110,6 +110,21 @@ process.env.VITE_COMPIIILE_THEME = argv.theme ?? "auto"
|
|
|
110
110
|
process.env.VITE_COMPIIILE_DATA = JSON.stringify(argv.data ?? {})
|
|
111
111
|
process.env.VITE_COMPIIILE_USE_AUTO_TITLES = /true/i.test(argv.useAutoTitles) // defaults to `false` if not set or not equal to `true`
|
|
112
112
|
|
|
113
|
+
|
|
114
|
+
// Get command and set env
|
|
115
|
+
const IS_DEV = argv._.length === 0 || argv._.includes("dev")
|
|
116
|
+
const IS_BUILD = argv._.includes("build")
|
|
117
|
+
const IS_PREVIEW = argv._.includes("preview")
|
|
118
|
+
|
|
119
|
+
const NODE_ENV_DEVELOPMENT = "development"
|
|
120
|
+
const NODE_ENV_PRODUCTION = "production"
|
|
121
|
+
if (IS_DEV) {
|
|
122
|
+
process.env.NODE_ENV = NODE_ENV_DEVELOPMENT
|
|
123
|
+
} else if (IS_BUILD || IS_PREVIEW) {
|
|
124
|
+
process.env.NODE_ENV = NODE_ENV_PRODUCTION
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
113
128
|
// Handling logo and favicon
|
|
114
129
|
process.env.VITE_COMPIIILE_LOGO = null
|
|
115
130
|
|
|
@@ -190,7 +205,8 @@ const astroConfig = {
|
|
|
190
205
|
kleur: resolve("kleur"),
|
|
191
206
|
clsx: resolve("clsx"),
|
|
192
207
|
"html-escaper": resolve("html-escaper"),
|
|
193
|
-
cssesc: resolve("cssesc"),
|
|
208
|
+
...(process.env.NODE_ENV === NODE_ENV_PRODUCTION ? {cssesc: resolve("cssesc")} : {}), // Not included in dev because of the 'module is not defined' error otherwise
|
|
209
|
+
mrmime: resolve("mrmime"),
|
|
194
210
|
"@vue/reactivity": resolve("@vue/reactivity"),
|
|
195
211
|
"@vue/shared": resolve("@vue/shared"),
|
|
196
212
|
fzf: resolve("fzf"),
|
|
@@ -222,25 +238,13 @@ if (process.env.VITE_COMPIIILE_BASE !== "/" && process.env.VITE_COMPIIILE_BASE.e
|
|
|
222
238
|
}
|
|
223
239
|
|
|
224
240
|
const run = async (astroConfig) => {
|
|
225
|
-
const IS_DEV = argv._.length === 0 || argv._.includes("dev")
|
|
226
|
-
const IS_BUILD = argv._.includes("build")
|
|
227
|
-
const IS_PREVIEW = argv._.includes("preview")
|
|
228
|
-
|
|
229
|
-
const NODE_ENV_DEVELOPMENT = "development"
|
|
230
|
-
const NODE_ENV_PRODUCTION = "production"
|
|
231
241
|
if (IS_DEV) {
|
|
232
|
-
process.env.NODE_ENV = NODE_ENV_DEVELOPMENT
|
|
233
|
-
|
|
234
242
|
const devServer = await dev(astroConfig)
|
|
235
243
|
devServer.watcher.add([source])
|
|
236
244
|
return devServer
|
|
237
245
|
} else if (IS_BUILD) {
|
|
238
|
-
process.env.NODE_ENV = NODE_ENV_PRODUCTION
|
|
239
|
-
|
|
240
246
|
return await build(astroConfig)
|
|
241
247
|
} else if (IS_PREVIEW) {
|
|
242
|
-
process.env.NODE_ENV = NODE_ENV_PRODUCTION
|
|
243
|
-
|
|
244
248
|
return await preview(astroConfig)
|
|
245
249
|
}
|
|
246
250
|
}
|
|
@@ -71,7 +71,7 @@ export default class {
|
|
|
71
71
|
".vuepress",
|
|
72
72
|
".git",
|
|
73
73
|
"node_modules",
|
|
74
|
-
"compiiile",
|
|
74
|
+
".compiiile",
|
|
75
75
|
"bin",
|
|
76
76
|
".idea",
|
|
77
77
|
".DS_Store",
|
|
@@ -122,6 +122,14 @@ export default class {
|
|
|
122
122
|
|
|
123
123
|
const meta = renderedMarkdown.metadata.frontmatter
|
|
124
124
|
|
|
125
|
+
if(meta.ignore){
|
|
126
|
+
const fileIndex = fileArray.findIndex(f => f.uuid === fileListItem.uuid)
|
|
127
|
+
if(fileIndex > -1){
|
|
128
|
+
fileArray.splice(fileIndex, 1)
|
|
129
|
+
}
|
|
130
|
+
continue
|
|
131
|
+
}
|
|
132
|
+
|
|
125
133
|
let firstHeading = null
|
|
126
134
|
if (
|
|
127
135
|
JSON.parse(process.env.VITE_COMPIIILE_USE_AUTO_TITLES) &&
|