@compiiile/compiiile 2.8.4 → 2.9.1

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.
@@ -207,7 +207,7 @@
207
207
  margin-bottom: 20px;
208
208
  display: block;
209
209
  max-width: 100%;
210
- overflow-x: scroll;
210
+ overflow-x: auto;
211
211
  }
212
212
 
213
213
  table tr {
@@ -20,8 +20,16 @@
20
20
  },
21
21
  async mounted() {
22
22
  const slidesContent = document.querySelector(".slides-content")
23
+
23
24
  slidesContent.innerHTML = `<div class="reveal deck"><div class="slides"><section>${slidesContent.innerHTML
24
25
  .split("<hr>")
26
+ .map((section) => {
27
+ // Handle fragments, `--` processed as `<p>—</p>` in HTML
28
+ const fragments = section.split("<p>—</p>")
29
+ return fragments.length === 1
30
+ ? section
31
+ : `<div class="fragment">` + fragments.join(`</div><div class="fragment">`) + "</div>"
32
+ })
25
33
  .join("</section><section>")}</section></div></div>`
26
34
 
27
35
  this.loaded = true
@@ -35,7 +43,8 @@
35
43
  height: "100%",
36
44
  margin: 0,
37
45
  minScale: 1,
38
- maxScale: 1
46
+ maxScale: 1,
47
+ pdfSeparateFragments: false
39
48
  })
40
49
 
41
50
  await Reveal.initialize({
@@ -44,11 +53,21 @@
44
53
 
45
54
  this.$refs.slidesDeckWrapper.style.opacity = 1
46
55
 
47
- Reveal.slide(new URLSearchParams(window.location.search).get("slide") || 0)
48
-
49
56
  Reveal.on("slidechanged", (event) => {
50
57
  history.replaceState({}, "", `?slide=${event.indexh}`)
58
+ Reveal.nextFragment()
51
59
  })
60
+
61
+ Reveal.on("fragmenthidden", function (event) {
62
+ if (
63
+ event.fragment.hasAttribute("data-fragment-index") &&
64
+ parseInt(event.fragment.dataset.fragmentIndex) === 0
65
+ ) {
66
+ Reveal.prev()
67
+ }
68
+ })
69
+
70
+ Reveal.slide(new URLSearchParams(window.location.search).get("slide") || 0)
52
71
  }
53
72
  }
54
73
  </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <button class="theme-switcher" @click="toggleTheme" aria-label="Theme switcher">
2
+ <button class="theme-switcher" aria-label="Theme switcher" @click="toggleTheme">
3
3
  <!-- sun-dim -->
4
4
  <svg
5
5
  class="theme-icon theme-icon--light"
@@ -56,10 +56,23 @@
56
56
  font-size: 6vmin;
57
57
  }
58
58
 
59
+ h4 {
60
+ font-size: 3vmin;
61
+ }
62
+
63
+ h5 {
64
+ font-size: 2.75vmin;
65
+ }
66
+
67
+ h6 {
68
+ font-size: 2.5vmin;
69
+ }
70
+
59
71
  font-family: "DM Sans Variable", sans-serif !important;
60
72
 
61
73
  p,
62
- li {
74
+ li,
75
+ a {
63
76
  font-size: max(3.25vmin, 18px) !important;
64
77
  }
65
78
 
@@ -113,7 +126,7 @@
113
126
  font-size: 2vmin;
114
127
  display: block;
115
128
  max-width: 100%;
116
- overflow-x: scroll;
129
+ overflow-x: auto;
117
130
  }
118
131
 
119
132
  table tr {
@@ -5,7 +5,7 @@ description: "Compiiile with some spice ! With the pro version, enhance your Mar
5
5
 
6
6
  # Compiiile-pro
7
7
 
8
- Compiiile with some spice :cherries:! With the ***pro*** version, enhance your Markdown files, add diagrams, mindmaps, admonitions, and ready-made components and get your knowledge-base or course ready to be served in one simple command :sparkles:.
8
+ Compiiile with some spice :cherries:! With the **_pro_** version, enhance your Markdown files, add diagrams, mindmaps, admonitions, and ready-made components and get your knowledge-base or course ready to be served in one simple command :sparkles:.
9
9
 
10
10
  ## Installation
11
11
 
@@ -34,6 +34,7 @@ npm install @compiiile/compiiile-pro # install as a project dependency with npm
34
34
  ## Usage
35
35
 
36
36
  Once installed, 3 commands are available that act the same as the usual `compiiile` command:
37
+
37
38
  - `compiiile-pro dev`
38
39
  - `compiiile-pro build`
39
40
  - `compiiile-pro preview`
@@ -62,13 +63,13 @@ COMPIIILE_PRO_LICENSE="XXXX-XXXX-XXXX-XXXX" COMPIIILE_PRO_EMAIL="john.doe@mail.c
62
63
 
63
64
  Similarly, you have 2 parameters that you can pass to the build command to use your licence: `--pro.license="<YOUR-LICENCE>"` and `--pro.email="<YOUR-EMAIL-USED-FOR-PURCHASE>"`.
64
65
 
65
- Here is the complete command as example:
66
+ Here is the complete command as example:
66
67
 
67
68
  ```bash
68
69
  compiiile-pro build --pro.license="XXXX-XXXX-XXXX-XXXX" --pro.email="john.doe@mail.com"
69
70
  ```
70
71
 
71
- ### Set it globally
72
+ ### Set it globally
72
73
 
73
74
  To use the same license on multiple projects, you can create a `.compiiilerc` file at the root of your user folder (`~/.compiiilerc`).
74
75
 
@@ -89,20 +90,20 @@ pro.email=<your-email>
89
90
 
90
91
  ## Affiliate
91
92
 
92
-
93
- You can become an affiliate and earn 20% on each sale by referring new customers (or should we say... *compiiilers ?*):
93
+ You can become an affiliate and earn 20% on each sale by referring new customers (or should we say... _compiiilers ?_):
94
94
 
95
95
  <a style="background-color:var(--highlight-color);color:#f7fafc;display:block;text-align:center;border-radius:4px;text-decoration:none;padding:10px;" href="https://compiiile.lemonsqueezy.com/affiliates" target="_blank">Become an affiliate</a>
96
96
 
97
97
  ## Added features
98
98
 
99
99
  Here is a list of features that the pro version adds:
100
- - add a button to copy code blocks and be able to specify the code block file name
101
- - add admonitions (or alerts) with different semantic colors
102
- - use any [Phosphor Icon](https://phosphoricons.com/) in your Markdown files or Vue components
103
- - add [MermaidJs](https://mermaid.js.org/#/) integration to write diagrams in Markdown, without compromising on style
104
- - add [Markmap](https://markmap.js.org/) integration to write mindmaps in Markdown from bullet-points lists
105
- - add [d2](https://d2lang.com/) integration to write diagrams
106
- - use ready-to-use components (for slides layouts, etc) in `mdx` files
100
+
101
+ - add a button to copy code blocks and be able to specify the code block file name
102
+ - add admonitions (or alerts) with different semantic colors
103
+ - use any [Phosphor Icon](https://phosphoricons.com/) in your Markdown files or Vue components
104
+ - add [MermaidJs](https://mermaid.js.org/#/) integration to write diagrams in Markdown, without compromising on style
105
+ - add [Markmap](https://markmap.js.org/) integration to write mindmaps in Markdown from bullet-points lists
106
+ - add [d2](https://d2lang.com/) integration to write diagrams
107
+ - use ready-to-use components (for slides layouts, etc) in `mdx` files
107
108
 
108
109
  See an overview of these features in the next page.
@@ -57,6 +57,7 @@ description: "Use icons, admonitions, mermaid diagrams, markmap mindmaps in Mark
57
57
  > [!CAUTION]
58
58
  > `Negative` potential consequences of an action.
59
59
  ```
60
+
60
61
  </details>
61
62
 
62
63
  ## Diagrams
@@ -81,8 +82,8 @@ graph TD
81
82
  C --> F[ Use a collection of components ]
82
83
  ```
83
84
  ````
85
+
84
86
  </details>
85
- ---
86
87
 
87
88
  ```markmap
88
89
  ---
@@ -116,6 +117,7 @@ markmap:
116
117
  - layout
117
118
  ```
118
119
  ````
120
+
119
121
  </details>
120
122
 
121
123
  ---
@@ -154,6 +156,7 @@ gitGraph
154
156
  merge components tag: "1.0.0"
155
157
  ```
156
158
  ````
159
+
157
160
  </details>
158
161
 
159
162
  ---
@@ -174,6 +177,7 @@ sequenceDiagram
174
177
  Server-->>Client: Return product list
175
178
  ```
176
179
  ````
180
+
177
181
  </details>
178
182
 
179
183
  ---
@@ -200,6 +204,7 @@ classDiagram
200
204
  BankAccount : +withdrawal(amount)
201
205
  ```
202
206
  ````
207
+
203
208
  </details>
204
209
 
205
210
  ---
@@ -230,6 +235,7 @@ stateDiagram-v2
230
235
  Crash --> [*]
231
236
  ```
232
237
  ````
238
+
233
239
  </details>
234
240
 
235
241
  ---
@@ -252,6 +258,7 @@ erDiagram
252
258
  CUSTOMER }|..|{ DELIVERY-ADDRESS : uses
253
259
  ```
254
260
  ````
261
+
255
262
  </details>
256
263
 
257
264
  ---
@@ -272,60 +279,62 @@ gantt
272
279
  <summary>Source</summary>
273
280
 
274
281
  ````md
275
- ```mermaid
276
- gantt
277
- title A Gantt Diagram
278
- dateFormat YYYY-MM-DD
279
- section Section
280
- A task :a1, 2014-01-01, 30d
281
- Another task :after a1, 20d
282
- section Another
283
- Task in Another :2014-01-12, 12d
284
- another task :24d
285
- ```
286
- ````
282
+
283
+ `````mermaid
284
+ gantt
285
+ title A Gantt Diagram
286
+ dateFormat YYYY-MM-DD
287
+ section Section
288
+ A task :a1, 2014-01-01, 30d
289
+ Another task :after a1, 20d
290
+ section Another
291
+ Task in Another :2014-01-12, 12d
292
+ another task :24d
293
+ ```
294
+ ````
287
295
  </details>
288
296
 
289
297
  ---
290
298
 
291
299
  ```mermaid
292
300
  pie title Pets adopted by volunteers
293
- "Dogs" : 386
294
- "Cats" : 85
295
- "Rats" : 15
296
- ```
301
+ "Dogs" : 386
302
+ "Cats" : 85
303
+ "Rats" : 15
304
+ `````
297
305
 
298
306
  <details>
299
307
  <summary>Source</summary>
300
308
 
301
309
  ````md
302
- ```mermaid
303
- pie title Pets adopted by volunteers
304
- "Dogs" : 386
305
- "Cats" : 85
306
- "Rats" : 15
307
- ```
308
- ````
310
+
311
+ `````mermaid
312
+ pie title Pets adopted by volunteers
313
+ "Dogs" : 386
314
+ "Cats" : 85
315
+ "Rats" : 15
316
+ ```
317
+ ````
309
318
  </details>
310
319
 
311
320
  ---
312
321
 
313
322
  ```mermaid
314
323
  quadrantChart
315
- title Reach and engagement of campaigns
316
- x-axis Low Reach --> High Reach
317
- y-axis Low Engagement --> High Engagement
318
- quadrant-1 We should expand
319
- quadrant-2 Need to promote
320
- quadrant-3 Re-evaluate
321
- quadrant-4 May be improved
322
- Campaign A: [0.3, 0.6]
323
- Campaign B: [0.45, 0.23]
324
- Campaign C: [0.57, 0.69]
325
- Campaign D: [0.78, 0.34]
326
- Campaign E: [0.40, 0.34]
327
- Campaign F: [0.35, 0.78]
328
- ```
324
+ title Reach and engagement of campaigns
325
+ x-axis Low Reach --> High Reach
326
+ y-axis Low Engagement --> High Engagement
327
+ quadrant-1 We should expand
328
+ quadrant-2 Need to promote
329
+ quadrant-3 Re-evaluate
330
+ quadrant-4 May be improved
331
+ Campaign A: [0.3, 0.6]
332
+ Campaign B: [0.45, 0.23]
333
+ Campaign C: [0.57, 0.69]
334
+ Campaign D: [0.78, 0.34]
335
+ Campaign E: [0.40, 0.34]
336
+ Campaign F: [0.35, 0.78]
337
+ `````
329
338
 
330
339
  <details>
331
340
  <summary>Source</summary>
@@ -348,6 +357,7 @@ quadrantChart
348
357
  Campaign F: [0.35, 0.78]
349
358
  ```
350
359
  ````
360
+
351
361
  </details>
352
362
 
353
363
  ---
@@ -374,6 +384,7 @@ xychart-beta
374
384
  line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
375
385
  ```
376
386
  ````
387
+
377
388
  </details>
378
389
 
379
390
  ---
@@ -402,6 +413,7 @@ timeline
402
413
  2006 : Twitter
403
414
  ```
404
415
  ````
416
+
405
417
  </details>
406
418
 
407
419
  ---
@@ -466,6 +478,7 @@ style: {
466
478
  }
467
479
  ```
468
480
  ````
481
+
469
482
  </details>
470
483
 
471
484
  ## Code blocks
@@ -525,18 +538,18 @@ The `CGrid` component allows you to use a grid layout (very useful for slides):
525
538
  </CGrid>
526
539
  ```
527
540
 
528
- - The `template` prop works just like the `grid-template-columns` CSS property, you can omit the `fr` unit, it will be processed automatically.
529
- - `template="1 1"` will make 2 columns of equal width
530
- - `template="2 1"` will make 2 columns with the first one using 2/3 width
531
- - You can vertically align items with the `align` prop, working like the `align-items` CSS property.
532
- - You can specify the gap between components with the `gap` prop (defaults to `40px`)
533
-
541
+ - The `template` prop works just like the `grid-template-columns` CSS property, you can omit the `fr` unit, it will be processed automatically.
542
+ - `template="1 1"` will make 2 columns of equal width
543
+ - `template="2 1"` will make 2 columns with the first one using 2/3 width
544
+ - You can vertically align items with the `align` prop, working like the `align-items` CSS property.
545
+ - You can specify the gap between components with the `gap` prop (defaults to `40px`)
534
546
 
535
547
  ### CCard
536
548
 
537
549
  The `CCard` component can be used as a traditional card or a link.
538
- - The `title` and `description` slots can be used for traditional cards
539
- - To get it to work as a link, just provide a Markdown link as default slot, and specify a hint text if needed with the `hintText` prop
550
+
551
+ - The `title` and `description` slots can be used for traditional cards
552
+ - To get it to work as a link, just provide a Markdown link as default slot, and specify a hint text if needed with the `hintText` prop
540
553
 
541
554
  <CGrid gap="20px" template="1 1">
542
555
  <CCard hintText="Go to the specific page">
@@ -551,6 +564,7 @@ The `CCard` component can be used as a traditional card or a link.
551
564
  <span slot="title">Title</span>
552
565
  <span slot="description">Some description</span>
553
566
  </CCard>
567
+
554
568
  </CGrid>
555
569
 
556
570
  &nbsp;
@@ -574,5 +588,5 @@ The `CCard` component can be used as a traditional card or a link.
574
588
  </CCard>
575
589
  </CGrid>
576
590
  ````
577
- </details>
578
591
 
592
+ </details>
package/README.md CHANGED
@@ -81,6 +81,18 @@ docker run -p 8080:80 <custom-image-name>
81
81
 
82
82
  > Replace `<custom-image-name>` with the tag you want. You should get Compiiile running on http://localhost:8080.
83
83
 
84
+ ### Using docker compose (with dev server)
85
+
86
+ First, copy the `./docker-compose.yaml` from this repo to your root folder.
87
+
88
+ Then just run the following command:
89
+
90
+ ```bash
91
+ docker compose up
92
+ ```
93
+
94
+ > You should get Compiiile running on http://localhost:4321.
95
+
84
96
  ## Quick start
85
97
 
86
98
  To make yourself an idea and quickly get started using Compiiile, here are some commands that you can run in your
@@ -155,6 +167,12 @@ To separate your slides, just separate the content of your markdown with:
155
167
 
156
168
  > There must be an empty line before and after the `---`
157
169
 
170
+ You can also make fragments within slides by using 2 hyphens:
171
+
172
+ ```md
173
+ --
174
+ ```
175
+
158
176
  :star2: You can make your slides print-ready by adding the `print-pdf` query parameter to your page,
159
177
  like: `https://compiiile.me/s/slides-preview?print-pdf`.
160
178
 
package/bin/config.js CHANGED
@@ -43,6 +43,53 @@ const argv = yargs(hideBin(process.argv))
43
43
  .command("dev", "launch development server")
44
44
  .command("build", "build")
45
45
  .command("preview", "preview")
46
+ .option("port", {
47
+ describe: "Port to use",
48
+ default: 4321
49
+ })
50
+ .option("host", {
51
+ describe: "Host to use",
52
+ default: "127.0.0.1"
53
+ })
54
+ .option("title", {
55
+ describe: "The title to display on the top-left of the User Interface"
56
+ })
57
+ .option("description", {
58
+ describe: "The description that is rendered by default for the SEO"
59
+ })
60
+ .option("logo", {
61
+ describe: "The relative path of the logo to display in the TopBar and as favicon"
62
+ })
63
+ .option("logoUrl", {
64
+ describe: "The url to go to when clicking on the logo, defaults to the home page if not set"
65
+ })
66
+ .option("dest", {
67
+ describe: "The folder in which to build files, defaults to `./.compiiile/dist`"
68
+ })
69
+ .option("siteUrl", {
70
+ describe: "The url of the website in production (without trailing slash), used for the SEO tag `og:image`"
71
+ })
72
+ .option("astroConfig", {
73
+ describe: "Override default Astro config (https://docs.astro.build/en/reference/configuration-reference/)"
74
+ })
75
+ .option("data", {
76
+ describe: "An object with data to use in MDX files"
77
+ })
78
+ .option("theme", {
79
+ describe:
80
+ "The website theme, value can be : `auto` (default value: adapts to system preferences) | `light` | `dark`"
81
+ })
82
+ .option("useAutoTitles", {
83
+ describe:
84
+ "If set to `true`, use the first file heading as title to be displayed in the navbar and for SEO. Defaults to `false`"
85
+ })
86
+ .option("noIndex", {
87
+ describe:
88
+ "If set to `true`, the `robots.txt` file will disallow all routes, preventing indexation. Defaults to `false`"
89
+ })
90
+ .option("vite.server.fs.allow", {
91
+ describe: "Add local paths to vite's server fs allow list"
92
+ })
46
93
  .help()
47
94
  .version(packageJSON.version).argv
48
95
 
@@ -94,6 +141,10 @@ const resolve = (mod) => {
94
141
  }
95
142
 
96
143
  const astroConfig = {
144
+ server: {
145
+ host: argv.host,
146
+ port: argv.port
147
+ },
97
148
  root: new URL("../.compiiile", import.meta.url).pathname,
98
149
  srcDir: new URL("../.compiiile/src", import.meta.url).pathname,
99
150
  outDir: path.join(source, argv.dest || ".compiiile/dist"),
@@ -0,0 +1,9 @@
1
+ services:
2
+ compiiile-dev:
3
+ image: node:lts
4
+ entrypoint: bash -c "yarn && yarn dev --host 0.0.0.0 --port 4321"
5
+ working_dir: /app
6
+ volumes:
7
+ - .:/app
8
+ ports:
9
+ - 4321:4321
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@compiiile/compiiile",
3
3
  "private": false,
4
- "version": "2.8.4",
4
+ "version": "2.9.1",
5
5
  "description": "The most convenient way to render a folder containing markdown files. Previewing and searching markdown files has never been that easy.",
6
6
  "author": "AlbanCrepel <alban.crepel@gmail.com>",
7
7
  "license": "GPL-3.0-only",
@@ -27,7 +27,7 @@
27
27
  "@astrojs/vue": "^4.0.9",
28
28
  "@babel/core": "^7.0.0-0",
29
29
  "@babel/eslint-parser": "^7.22.15",
30
- "@compiiile/compiiile-pro": "^1.0.5",
30
+ "@compiiile/compiiile-pro": "^1.0.6",
31
31
  "@fontsource-variable/archivo": "^5.0.16",
32
32
  "@fontsource-variable/dm-sans": "^5.0.3",
33
33
  "@fontsource-variable/jetbrains-mono": "^5.0.18",