@compiiile/compiiile 2.20.0 → 2.21.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.
@@ -68,6 +68,10 @@
68
68
  })
69
69
 
70
70
  Reveal.slide(new URLSearchParams(window.location.search).get("slide") || 0)
71
+
72
+ // Useful for custom plugins to know when the slides are ready
73
+ window.compiiileSlidesReady = true
74
+ document.dispatchEvent(new CustomEvent("compiiile-slides-ready", { detail: { deck } }))
71
75
  }
72
76
  }
73
77
  </script>
@@ -76,6 +76,7 @@
76
76
  fill: var(--dimmed-text-color);
77
77
  will-change: opacity, transform;
78
78
  transform-origin: center;
79
+ opacity: 0;
79
80
  transition:
80
81
  0.2s opacity,
81
82
  0.2s transform var(--ease-in-out-quart);
@@ -17,7 +17,7 @@
17
17
  }
18
18
  },
19
19
  mounted() {
20
- // This is to delegate folder state to the client instead of the values computed on page load to prevent blinking
20
+ // This is to delegate folder state to the client instead of the values computed on page load to prevent blinking
21
21
  document.getElementById("compiiile-folders-state-style")?.remove()
22
22
  }
23
23
  }
@@ -3,7 +3,7 @@ import ThemeLoader from "./ThemeLoader.astro";
3
3
  import NavBarFoldersStateLoader from "./NavBarFoldersStateLoader.astro";
4
4
  import '../utils/styles.js'
5
5
  import {SEO} from "astro-seo"
6
- const {title, description, isNotFoundPage} = Astro.props
6
+ const {title, description, isNotFoundPage, layoutType} = Astro.props
7
7
  import { site } from "virtual:compiiile"
8
8
  const titleTemplate = site.title ? `%s | ${ site.title }` : ''
9
9
  const siteUrl = site.siteUrl || Astro.url.origin
@@ -19,7 +19,7 @@ const metaDescription = description || site.description
19
19
  const defaultTheme = site.theme
20
20
  ---
21
21
 
22
- <html lang="en">
22
+ <html lang="en" class:list={[`layout--${layoutType}`]}>
23
23
  <head>
24
24
  <meta charset="utf-8">
25
25
  <meta name="viewport" content="width=device-width, initial-scale=1">
@@ -4,7 +4,7 @@ import BaseLayout from "./BaseLayout.astro";
4
4
  const { title, description, textAlign } = Astro.props
5
5
  ---
6
6
 
7
- <BaseLayout title={ title } description={ description } isNotFoundPage={ false }>
7
+ <BaseLayout title={ title } description={ description } isNotFoundPage={ false } layoutType="slides">
8
8
  <SlidesContent client:load textAlign={textAlign}>
9
9
  <slot></slot>
10
10
  </SlidesContent>
@@ -12,7 +12,7 @@ if(currentPath.length > 1 && currentPath.endsWith("/")){
12
12
  ---
13
13
 
14
14
 
15
- <BaseLayout title={ title } description={ description } isNotFoundPage={ isNotFoundPage }>
15
+ <BaseLayout title={ title } description={ description } isNotFoundPage={ isNotFoundPage } layoutType="workspace">
16
16
  <div class="page">
17
17
  <TopBar client:load />
18
18
 
@@ -1,185 +1,185 @@
1
1
  /* Putting the style from the ContentWrapper component here so that no "flash" occur in dev mode with HMR */
2
2
  .page .content-wrapper .markdown-content {
3
- margin-right: calc(var(--toc-width) + 80px);
4
-
5
- h1,
6
- h2,
7
- h3,
8
- h4,
9
- h5 {
10
- &:before {
11
- /* hack to offset scroll on route hash navigation */
12
- padding-top: calc(var(--top-bar-height) - 1px);
13
- margin-top: calc((var(--top-bar-height) - 1px) * -1);
14
- content: " ";
15
- display: block;
16
- }
17
- }
18
-
19
- h2,
20
- h3,
21
- h4,
22
- h5,
23
- h6 {
24
- margin: 20px 0 10px;
25
- }
26
-
27
- h2 {
28
- margin-top: 40px;
29
- }
30
-
31
- p code,
32
- li code,
33
- table code {
34
- padding: 2px 4px;
35
- border-radius: 3px;
36
- background-color: var(--code-background-color);
37
- border: solid 1px var(--code-background-color); /* same color, useful when printing without background graphics */
38
- color: var(--code-color);
39
- font-family: var(--monospace);
40
- font-size: 0.85rem;
41
- }
42
-
43
- p,
44
- ul {
45
- line-height: 1.618rem;
46
- margin-bottom: 1rem;
47
- }
48
-
49
- ul {
50
- padding-left: 40px;
51
- }
52
-
53
- hr {
54
- margin: 40px 0;
55
- background-color: var(--separator-color);
56
- height: 1px;
57
- border: 0;
58
- }
59
-
60
- blockquote {
61
- background-color: var(--blockquote-background-color);
62
- border: solid 1px var(--blockquote-border-color);
63
- border-radius: 8px;
64
- padding: 0.5em 1em;
65
- color: var(--blockquote-color);
66
- margin: 20px 0;
67
-
68
- p {
69
- margin-bottom: 0;
70
- }
71
-
72
- code {
73
- background-color: rgb(169 156 231 / 22%);
74
- }
75
- }
76
-
77
- img {
78
- max-width: 100%;
79
- margin: 20px auto;
80
- display: block;
81
- object-fit: contain;
82
- height: auto;
83
- }
84
-
85
- a {
86
- color: var(--link-color);
87
- }
88
-
89
- table {
90
- padding: 0;
91
- border-collapse: collapse;
92
- margin-bottom: 20px;
93
- display: block;
94
- max-width: 100%;
95
- overflow-x: auto;
96
- }
97
-
98
- table tr {
99
- border-top: 1px solid var(--table-border-color);
100
- background-color: var(--table-odd-lines-background-color);
101
- margin: 0;
102
- padding: 0;
103
- }
104
-
105
- table tr:nth-child(2n) {
106
- background-color: var(--table-even-lines-background-color);
107
- }
108
-
109
- table tr th {
110
- font-weight: bold;
111
- border: 1px solid var(--table-border-color);
112
- text-align: left;
113
- margin: 0;
114
- padding: 6px 13px;
115
- }
116
-
117
- table tr td {
118
- border: 1px solid var(--table-border-color);
119
- text-align: left;
120
- margin: 0;
121
- padding: 6px 13px;
122
- }
123
-
124
- table tr th :first-child,
125
- table tr td :first-child {
126
- margin-top: 0;
127
- }
128
-
129
- table tr th :last-child,
130
- table tr td :last-child {
131
- margin-bottom: 0;
132
- }
133
-
134
- pre code {
135
- margin-bottom: 1rem;
136
- }
137
-
138
- pre.astro-code {
139
- margin-bottom: 20px;
140
- font-size: 0.85rem;
141
- }
142
-
143
- .header-anchor {
144
- float: left;
145
- margin-left: -0.87em;
146
- padding-right: 0.23em;
147
- font-weight: 500;
148
- opacity: 0;
149
- transition: opacity 0.25s;
150
- text-decoration: none;
151
- }
152
-
153
- h1:hover .header-anchor,
154
- h2:hover .header-anchor,
155
- h3:hover .header-anchor,
156
- h4:hover .header-anchor,
157
- h5:hover .header-anchor,
158
- h6:hover .header-anchor,
159
- .header-anchor:focus {
160
- opacity: 1;
161
- }
3
+ margin-right: calc(var(--toc-width) + 80px);
4
+
5
+ h1,
6
+ h2,
7
+ h3,
8
+ h4,
9
+ h5 {
10
+ &:before {
11
+ /* hack to offset scroll on route hash navigation */
12
+ padding-top: calc(var(--top-bar-height) - 1px);
13
+ margin-top: calc((var(--top-bar-height) - 1px) * -1);
14
+ content: " ";
15
+ display: block;
16
+ }
17
+ }
18
+
19
+ h2,
20
+ h3,
21
+ h4,
22
+ h5,
23
+ h6 {
24
+ margin: 20px 0 10px;
25
+ }
26
+
27
+ h2 {
28
+ margin-top: 40px;
29
+ }
30
+
31
+ p code,
32
+ li code,
33
+ table code {
34
+ padding: 2px 4px;
35
+ border-radius: 3px;
36
+ background-color: var(--code-background-color);
37
+ border: solid 1px var(--code-background-color); /* same color, useful when printing without background graphics */
38
+ color: var(--code-color);
39
+ font-family: var(--monospace);
40
+ font-size: 0.85rem;
41
+ }
42
+
43
+ p,
44
+ ul {
45
+ line-height: 1.618rem;
46
+ margin-bottom: 1rem;
47
+ }
48
+
49
+ ul {
50
+ padding-left: 40px;
51
+ }
52
+
53
+ hr {
54
+ margin: 40px 0;
55
+ background-color: var(--separator-color);
56
+ height: 1px;
57
+ border: 0;
58
+ }
59
+
60
+ blockquote {
61
+ background-color: var(--blockquote-background-color);
62
+ border: solid 1px var(--blockquote-border-color);
63
+ border-radius: 8px;
64
+ padding: 0.5em 1em;
65
+ color: var(--blockquote-color);
66
+ margin: 20px 0;
67
+
68
+ p {
69
+ margin-bottom: 0;
70
+ }
71
+
72
+ code {
73
+ background-color: rgb(169 156 231 / 22%);
74
+ }
75
+ }
76
+
77
+ img {
78
+ max-width: 100%;
79
+ margin: 20px auto;
80
+ display: block;
81
+ object-fit: contain;
82
+ height: auto;
83
+ }
84
+
85
+ a {
86
+ color: var(--link-color);
87
+ }
88
+
89
+ table {
90
+ padding: 0;
91
+ border-collapse: collapse;
92
+ margin-bottom: 20px;
93
+ display: block;
94
+ max-width: 100%;
95
+ overflow-x: auto;
96
+ }
97
+
98
+ table tr {
99
+ border-top: 1px solid var(--table-border-color);
100
+ background-color: var(--table-odd-lines-background-color);
101
+ margin: 0;
102
+ padding: 0;
103
+ }
104
+
105
+ table tr:nth-child(2n) {
106
+ background-color: var(--table-even-lines-background-color);
107
+ }
108
+
109
+ table tr th {
110
+ font-weight: bold;
111
+ border: 1px solid var(--table-border-color);
112
+ text-align: left;
113
+ margin: 0;
114
+ padding: 6px 13px;
115
+ }
116
+
117
+ table tr td {
118
+ border: 1px solid var(--table-border-color);
119
+ text-align: left;
120
+ margin: 0;
121
+ padding: 6px 13px;
122
+ }
123
+
124
+ table tr th :first-child,
125
+ table tr td :first-child {
126
+ margin-top: 0;
127
+ }
128
+
129
+ table tr th :last-child,
130
+ table tr td :last-child {
131
+ margin-bottom: 0;
132
+ }
133
+
134
+ pre code {
135
+ margin-bottom: 1rem;
136
+ }
137
+
138
+ pre.astro-code {
139
+ margin-bottom: 20px;
140
+ font-size: 0.85rem;
141
+ }
142
+
143
+ .header-anchor {
144
+ float: left;
145
+ margin-left: -0.87em;
146
+ padding-right: 0.23em;
147
+ font-weight: 500;
148
+ opacity: 0;
149
+ transition: opacity 0.25s;
150
+ text-decoration: none;
151
+ }
152
+
153
+ h1:hover .header-anchor,
154
+ h2:hover .header-anchor,
155
+ h3:hover .header-anchor,
156
+ h4:hover .header-anchor,
157
+ h5:hover .header-anchor,
158
+ h6:hover .header-anchor,
159
+ .header-anchor:focus {
160
+ opacity: 1;
161
+ }
162
162
  }
163
163
 
164
164
  .siblings {
165
- display: flex;
166
- margin-right: calc(var(--toc-width) + 80px);
167
- color: var(--link-color);
168
- margin-top: 80px;
169
- gap: 20px;
170
- flex-wrap: wrap;
171
-
172
- .sibling-link {
173
- text-decoration: none;
174
- border-radius: 2px;
175
-
176
- &:focus-visible {
177
- outline: solid 1px var(--separator-color);
178
- }
179
- }
180
-
181
- .sibling-link--next {
182
- text-align: right;
183
- margin-left: auto;
184
- }
165
+ display: flex;
166
+ margin-right: calc(var(--toc-width) + 80px);
167
+ color: var(--link-color);
168
+ margin-top: 80px;
169
+ gap: 20px;
170
+ flex-wrap: wrap;
171
+
172
+ .sibling-link {
173
+ text-decoration: none;
174
+ border-radius: 2px;
175
+
176
+ &:focus-visible {
177
+ outline: solid 1px var(--separator-color);
178
+ }
179
+ }
180
+
181
+ .sibling-link--next {
182
+ text-align: right;
183
+ margin-left: auto;
184
+ }
185
185
  }
package/bin/config.js CHANGED
@@ -13,7 +13,7 @@ import { createRequire } from "node:module"
13
13
  import { packageDirectory } from "package-directory"
14
14
 
15
15
  import { loadConfig } from "./loadConfig.js"
16
- import Context from "./vitePluginCompiiile/models/Context.js";
16
+ import Context from "./vitePluginCompiiile/models/Context.js"
17
17
 
18
18
  const { argv, localIntegrations, configFromFile, source, hasPublicFiles, publicDir } = await loadConfig()
19
19
 
@@ -60,11 +60,17 @@ const astroConfig = {
60
60
  {
61
61
  name: "include-dependencies",
62
62
  hooks: {
63
+ // fixing packages not included for certain environments (like 'piccolore' when installed globally)
63
64
  "astro:build:setup": ({ updateConfig }) => {
64
65
  updateConfig({
65
- vite: {
66
- ssr: {
67
- noExternal: true
66
+ ssr: {
67
+ noExternal: true
68
+ },
69
+ environments: {
70
+ prerender: {
71
+ resolve: {
72
+ noExternal: true
73
+ }
68
74
  }
69
75
  }
70
76
  })
package/bin/loadConfig.js CHANGED
@@ -19,8 +19,8 @@ export const loadConfig = async () => {
19
19
  3. default config as fallback
20
20
  */
21
21
  let configFromFile = {}
22
- let compiiileConfig = {}
23
22
  try {
23
+ let compiiileConfig = {}
24
24
  compiiileConfig = await loadConfigFile({
25
25
  name: process.env.COMPIIILE_TEMP_CONFIG_NAME || "compiiile",
26
26
  cwd: process.env.COMPIIILE_TEMP_DIR || source
@@ -1,12 +1,9 @@
1
- import Context from "./models/Context.js"
2
1
  import { createMarkdownProcessor } from "@astrojs/markdown-remark"
3
- import {rehypePlugins, remarkPlugins, shikiConfig} from "./markdownConfig.js"
2
+ import { rehypePlugins, remarkPlugins, shikiConfig } from "./markdownConfig.js"
4
3
  import path from "node:path"
5
4
  import { loadConfig } from "../loadConfig.js"
6
5
  import { promises as fs } from "node:fs"
7
6
 
8
- const source = "."
9
-
10
7
  const pathFromSource = (filePath) => {
11
8
  return filePath?.replace(process.env.COMPIIILE_SOURCE + "/", "")
12
9
  }
@@ -43,7 +40,11 @@ export default function compiiile(sharedContext) {
43
40
 
44
41
  const routeListItem = sharedContext.routeList.find((route) => route.fullPath === absolutePath)
45
42
 
46
- const markdownProcessor = await createMarkdownProcessor({remarkPlugins, rehypePlugins: rehypePlugins(sharedContext), shikiConfig})
43
+ const markdownProcessor = await createMarkdownProcessor({
44
+ remarkPlugins,
45
+ rehypePlugins: rehypePlugins(sharedContext),
46
+ shikiConfig
47
+ })
47
48
  const renderedMarkdown = await markdownProcessor.render(content)
48
49
 
49
50
  const title = sharedContext.getFileTitleFromProcessedMarkdown(renderedMarkdown)
@@ -5,7 +5,7 @@ import rehypeSlug from "rehype-slug"
5
5
  import rehypeAutolinkHeadings from "rehype-autolink-headings"
6
6
  import { h } from "hastscript"
7
7
  import rehypeHandleYamlMatterPlugin from "./rehypeHandleYamlMatterPlugin.js"
8
- import { unified } from '@astrojs/markdown-remark';
8
+ import { unified } from "@astrojs/markdown-remark"
9
9
 
10
10
  export const remarkPlugins = [remarkEmoji]
11
11
  export const rehypePlugins = (sharedContext) => [
@@ -5,7 +5,7 @@ import FileListItem from "./FileListItem.js"
5
5
  import FilesTreeItem from "./FilesTreeItem.js"
6
6
  import RouteListItem from "./RouteListItem.js"
7
7
  import { createMarkdownProcessor } from "@astrojs/markdown-remark"
8
- import {remarkPlugins, rehypePlugins, shikiConfig} from "../markdownConfig.js"
8
+ import { remarkPlugins, rehypePlugins, shikiConfig } from "../markdownConfig.js"
9
9
  import { unemojify } from "node-emoji"
10
10
  import slugify from "slugify"
11
11
  import parseIgnore from "parse-gitignore"
@@ -152,7 +152,11 @@ export default class {
152
152
  encoding: "utf8"
153
153
  })
154
154
 
155
- const markdownProcessor = await createMarkdownProcessor({remarkPlugins, rehypePlugins: rehypePlugins(this), shikiConfig})
155
+ const markdownProcessor = await createMarkdownProcessor({
156
+ remarkPlugins,
157
+ rehypePlugins: rehypePlugins(this),
158
+ shikiConfig
159
+ })
156
160
  const renderedMarkdown = await markdownProcessor.render(markdownContent)
157
161
 
158
162
  fileListItem.textContent = unemojify(
@@ -11,7 +11,7 @@ export default function rehypeLinkPlugin(sharedContext) {
11
11
  const filePath = decodedFilePath.replace(process.env.COMPIIILE_SOURCE, "")
12
12
 
13
13
  node.properties.href = sharedContext?.fileRouteMap?.[filePath.substring(1)] + linkTargetUrl.hash
14
- } else if(!node.properties.href.startsWith("#")){
14
+ } else if (!node.properties.href.startsWith("#")) {
15
15
  node.properties.target = "_blank"
16
16
  }
17
17
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@compiiile/compiiile",
3
3
  "private": false,
4
- "version": "2.20.0",
4
+ "version": "2.21.0",
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",
@@ -21,24 +21,24 @@
21
21
  "url": "git+https://github.com/compiiile/compiiile.git"
22
22
  },
23
23
  "dependencies": {
24
- "@astrojs/markdown-remark": "^7.2.0",
25
- "@astrojs/mdx": "^7.0.0",
24
+ "@astrojs/markdown-remark": "^7.2.2",
25
+ "@astrojs/mdx": "^7.0.5",
26
26
  "@astrojs/sitemap": "^3.7.3",
27
- "@astrojs/vue": "^7.0.0",
28
- "@babel/core": "^7.28.5",
29
- "@babel/eslint-parser": "^7.28.5",
30
- "@babel/parser": "^7.28.5",
31
- "@compiiile/compiiile-print": "^1.1.0",
32
- "@eslint/compat": "^1.4.1",
33
- "@eslint/js": "^9.39.2",
34
- "@fontsource-variable/archivo": "^5.2.8",
35
- "@fontsource-variable/dm-sans": "^5.2.8",
36
- "@fontsource-variable/jetbrains-mono": "^5.2.8",
27
+ "@astrojs/vue": "^7.0.2",
28
+ "@babel/core": "^8.0.1",
29
+ "@babel/eslint-parser": "^8.0.1",
30
+ "@babel/parser": "^8.0.4",
31
+ "@compiiile/compiiile-print": "1.1.1",
32
+ "@eslint/compat": "^2.1.0",
33
+ "@eslint/js": "^10.0.1",
34
+ "@fontsource-variable/archivo": "^5.3.0",
35
+ "@fontsource-variable/dm-sans": "^5.3.0",
36
+ "@fontsource-variable/jetbrains-mono": "^5.3.0",
37
37
  "@phosphor-icons/web": "^2.1.2",
38
- "astro": "^7.0.3",
38
+ "astro": "^7.2.2",
39
39
  "astro-seo": "^1.1.0",
40
40
  "c12": "^3.3.4",
41
- "eslint": "^9.39.2",
41
+ "eslint": "^10.8.1",
42
42
  "eslint-config-prettier": "^10.1.8",
43
43
  "eslint-plugin-vue": "^10.6.2",
44
44
  "estree-walker": "^3.0.3",
@@ -49,6 +49,7 @@
49
49
  "node-emoji": "^2.2.0",
50
50
  "package-directory": "^8.1.0",
51
51
  "parse-gitignore": "^2.0.0",
52
+ "piccolore": "^0.1.3",
52
53
  "prettier": "^3.7.4",
53
54
  "rehype-autolink-headings": "^7.1.0",
54
55
  "rehype-slug": "^6.0.0",
@@ -58,8 +59,8 @@
58
59
  "typescript": "^5.9.3",
59
60
  "uuid": "^13.0.0",
60
61
  "vfile-matter": "^5.0.1",
61
- "vite": "^8.1.0",
62
- "vue": "^3.5.39",
62
+ "vite": "^8.2.1",
63
+ "vue": "^3.5.41",
63
64
  "yargs": "^18.0.0",
64
65
  "zod": "^3.25.76"
65
66
  },
@@ -1,23 +0,0 @@
1
- /* eslint-disable */
2
- // @ts-nocheck
3
- // Generated by unplugin-vue-components
4
- // Read more: https://github.com/vuejs/core/pull/3399
5
- export {}
6
-
7
- /* prettier-ignore */
8
- declare module 'vue' {
9
- export interface GlobalComponents {
10
- ClientScript: typeof import('./src/components/ClientScript.vue')['default']
11
- ContentWrapper: typeof import('./src/components/ContentWrapper.vue')['default']
12
- FilesTree: typeof import('./src/components/layout/navBar/FilesTree.vue')['default']
13
- HamburgerButton: typeof import('./src/components/layout/HamburgerButton.vue')['default']
14
- NavBar: typeof import('./src/components/layout/navBar/NavBar.vue')['default']
15
- NavListItem: typeof import('./src/components/layout/navBar/NavListItem.vue')['default']
16
- SearchBar: typeof import('./src/components/searchBar/SearchBar.vue')['default']
17
- SearchResult: typeof import('./src/components/searchBar/SearchResult.vue')['default']
18
- SlidesContent: typeof import('./src/components/SlidesContent.vue')['default']
19
- TableOfContent: typeof import('./src/components/TableOfContent.vue')['default']
20
- ThemeSwitcher: typeof import('./src/components/layout/ThemeSwitcher.vue')['default']
21
- TopBar: typeof import('./src/components/layout/TopBar.vue')['default']
22
- }
23
- }