@compiiile/compiiile 2.4.0 → 2.5.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/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Compiiile
2
2
 
3
- > Compiiile is the most convenient way to render a folder containing markdown files. Previewing and searching markdown files has never been that easy (it's really just a command away !) :sparkles:
3
+ > Compiiile is the most convenient way to render a folder containing markdown files. Previewing and searching markdown
4
+ > files has never been that easy (it's really just a command away !) :sparkles:
4
5
 
5
6
  ## Preview
6
7
 
@@ -11,28 +12,34 @@
11
12
  ## Purpose
12
13
 
13
14
  I document everything in markdown and have always been frustrated not having a simple tool to just **preview** a whole
14
- folder, being able to **search** through it, make **slides** out of it, and get a **production-ready** build of all the files as a knowledge base. On
15
+ folder, being able to **search** through it, make **slides** out of it, and get a **production-ready** build of all the
16
+ files as a knowledge base. On
15
17
  top of that, finding a tool with a sweet and simple UI is not that easy.
16
18
 
17
19
  That's what Compiiile does. And it does it hassle-free !
18
20
 
19
21
  ## Features
20
22
 
21
- - [x] 📦 **No config required, everything just works out of the box, without changing your files** (resolves images and relative links (cross-references), print-ready rendering)
22
- - [x] 🌱 Available everywhere with static files deployment: just host it somewhere and access it in any browser on your computer, phone or whatever you are using
23
- - [x] :link: Quick access to your files via the navbar and links to the previous and next file (with table of content generation)
23
+ - [x] 📦 **No config required, everything just works out of the box, without changing your files** (resolves images and
24
+ relative links (cross-references), print-ready rendering, :sunny: light and :first_quarter_moon_with_face: dark themes)
25
+ - [x] 🌱 Available everywhere with static files deployment: just host it somewhere and access it in any browser on your
26
+ computer, phone or whatever you are using
27
+ - [x] :link: Quick access to your files via the navbar and links to the previous and next file (with table of content
28
+ generation)
24
29
  - [x] :tv: Display some files as slides
25
30
  - [x] :mag: **Full-text quick search with content preview**
26
31
  - [x] :zap: Hot-reload content preview as you edit it
27
- - [x] :tada: Supports MDX files
32
+ - [x] :tada: Supports MDX files: add your own components to your documentation
28
33
  - [x] :bulb: Can serve as knowledge base
29
34
  - [x] :wrench: Customizable by env variables or config file, it's up to you
30
35
  - [x] :star2: You get it, it simply does the job, period.
31
36
 
32
37
  ### What Compiiile isn't
33
38
 
34
- - It's not a markdown editor, there are already plenty available, just choose the one that works best for you, even the simplest text editor will do.
35
- - It's not like VuePress, VitePress, Docusaurus or Notion. Compiiile's goal is to stay simple and stupidly easy without any configuration.
39
+ - It's not a markdown editor, there are already plenty available, just choose the one that works best for you, even the
40
+ simplest text editor will do.
41
+ - It's not like VuePress, VitePress, Docusaurus or Notion. Compiiile's goal is to stay simple and stupidly easy without
42
+ any configuration.
36
43
 
37
44
  > The goal is to help people rely purely on a **language** (_markdown_), not on _any_ platform.
38
45
 
@@ -42,7 +49,8 @@ You can install Compiiile either globally or per-project:
42
49
 
43
50
  ### Globally
44
51
 
45
- Open a terminal and type one of these commands, whether using [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/) depending on which package manager you are using:
52
+ Open a terminal and type one of these commands, whether using [npm](https://www.npmjs.com/)
53
+ or [yarn](https://yarnpkg.com/) depending on which package manager you are using:
46
54
 
47
55
  ```bash
48
56
  yarn global add @compiiile/compiiile # install globally with yarn
@@ -52,7 +60,8 @@ npm install -g @compiiile/compiiile # install globally with npm
52
60
 
53
61
  ### Per-project
54
62
 
55
- Open a terminal inside the folder containing your markdown files. Then, add Compiiile as a local command using yarn or npm:
63
+ Open a terminal inside the folder containing your markdown files. Then, add Compiiile as a local command using yarn or
64
+ npm:
56
65
 
57
66
  ```bash
58
67
  yarn add @compiiile/compiiile # install as a project dependency with yarn
@@ -62,7 +71,8 @@ npm install @compiiile/compiiile # install as a project dependency with npm
62
71
 
63
72
  ## Quick start
64
73
 
65
- To make yourself an idea and quickly get started using Compiiile, here are some commands that you can run in your terminal to get Compiiile running with a couple of markdown files as tests:
74
+ To make yourself an idea and quickly get started using Compiiile, here are some commands that you can run in your
75
+ terminal to get Compiiile running with a couple of markdown files as tests:
66
76
 
67
77
  ```bash
68
78
  mkdir test-compiiile && cd test-compiiile # creating a new folder and go into this folder
@@ -120,7 +130,8 @@ asSlides: true
120
130
  ```
121
131
 
122
132
  If you are not acquainted with frontmatter, it's just some file-specific parameters that you can put at the very
123
- beginning of your file to be processed (make sure to separate frontmatter values from your content with an empty line after the last `---`).
133
+ beginning of your file to be processed (make sure to separate frontmatter values from your content with an empty line
134
+ after the last `---`).
124
135
 
125
136
  By adding the frontmatter parameter, the page will directly open up as slides.
126
137
 
@@ -132,13 +143,16 @@ To separate your slides, just separate the content of your markdown with:
132
143
 
133
144
  > There must be an empty line before and after the `---`
134
145
 
135
- :star2: You can make your slides print-ready by adding the `print-pdf` query parameter to your page, like: `https://compiiile.me/s/slides-preview?print-pdf`.
146
+ :star2: You can make your slides print-ready by adding the `print-pdf` query parameter to your page,
147
+ like: `https://compiiile.me/s/slides-preview?print-pdf`.
136
148
 
137
149
  Other frontmatter keys are handled:
138
150
 
139
151
  - `title`: set the title to be displayed in the navbar and for SEO
140
152
  - `description`: set the description for SEO
141
- - `textAlign`: possible values are [CSS text-align values](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) (`left`, `center`, ...). This changes the default text alignment in slides. The default value is `center`.
153
+ - `textAlign`: possible values
154
+ are [CSS text-align values](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) (`left`, `center`, ...). This
155
+ changes the default text alignment in slides. The default value is `center`.
142
156
 
143
157
  ### Routing
144
158
 
@@ -148,17 +162,18 @@ The home page of Compiiile (`/`) points to a `README.md` file located at the roo
148
162
 
149
163
  Here is the list of parameters that you can set to customize Compiiile (none are required):
150
164
 
151
- | Parameter | Type | Description |
152
- |------------------------| ---------- |-------------------------------------------------------------------------------------------------|
153
- | `title` | `string` | The title to display on the top-left of the User Interface |
154
- | `description` | `string` | The description that is rendered by default for the SEO |
155
- | `logo` | `string` | The relative path of the logo to display in the TopBar and as favicon |
156
- | `logoUrl` | `string` | The url to go to when clicking on the logo, defaults to the home page if not set |
157
- | `dest` | `string` | The folder in which to build files, defaults to `./.compiiile/dist` |
158
- | `siteUrl` | `string` | The url of the website in production (without trailing slash), used for the SEO tag `og:image` |
159
- | `astroConfig` | `Object` | Override [default Astro config](https://docs.astro.build/en/reference/configuration-reference/) |
160
- | `data` | `Object` | An object with data to use in MDX files (check use case below) |
161
- | `vite.server.fs.allow` | `string[]` | Add local paths to vite's server fs allow list |
165
+ | Parameter | Type | Description |
166
+ | ---------------------- | ---------- | ----------------------------------------------------------------------------------------------------------- |
167
+ | `title` | `string` | The title to display on the top-left of the User Interface |
168
+ | `description` | `string` | The description that is rendered by default for the SEO |
169
+ | `logo` | `string` | The relative path of the logo to display in the TopBar and as favicon |
170
+ | `logoUrl` | `string` | The url to go to when clicking on the logo, defaults to the home page if not set |
171
+ | `dest` | `string` | The folder in which to build files, defaults to `./.compiiile/dist` |
172
+ | `siteUrl` | `string` | The url of the website in production (without trailing slash), used for the SEO tag `og:image` |
173
+ | `astroConfig` | `Object` | Override [default Astro config](https://docs.astro.build/en/reference/configuration-reference/) |
174
+ | `data` | `Object` | An object with data to use in MDX files (check use case below) |
175
+ | `theme` | `string` | The website theme, value can be : `auto` (default value: adapts to system preferences) \| `light` \| `dark` |
176
+ | `vite.server.fs.allow` | `string[]` | Add local paths to vite's server fs allow list |
162
177
 
163
178
  You can use these parameters in 2 ways:
164
179
 
@@ -193,7 +208,8 @@ export default {
193
208
 
194
209
  v2 of Compiiile allows you to use MDX files with Vue components.
195
210
 
196
- For it to work, you should install some dependencies in your project folder: `yarn add vue astro fzf` (or `npm install vue astro fzf`).
211
+ For it to work, you should install some dependencies in your project folder: `yarn add vue astro fzf` (
212
+ or `npm install vue astro fzf`).
197
213
 
198
214
  ### Using components
199
215
 
@@ -246,11 +262,14 @@ import Test from "./Test.vue"
246
262
  <Test client:load />
247
263
  ```
248
264
 
249
- You should use [Astro's client directives](https://docs.astro.build/en/reference/directives-reference/#client-directives) to load your component's script.
265
+ You should
266
+ use [Astro's client directives](https://docs.astro.build/en/reference/directives-reference/#client-directives) to load
267
+ your component's script.
250
268
 
251
269
  ### Use config data values
252
270
 
253
- To use config values, you can access it by importing the `site` variable in your MDX file and then access the `data` key:
271
+ To use config values, you can access it by importing the `site` variable in your MDX file and then access the `data`
272
+ key:
254
273
 
255
274
  ```mdx
256
275
  import { site } from "virtual:compiiile"
@@ -260,7 +279,8 @@ import { site } from "virtual:compiiile"
260
279
 
261
280
  ## Common issues
262
281
 
263
- - Make sure that the absolute path to the folder where you are running Compiiile doesn't contain any special character as it could prevent the project initialization.
282
+ - Make sure that the absolute path to the folder where you are running Compiiile doesn't contain any special character
283
+ as it could prevent the project initialization.
264
284
 
265
285
  ## Special thanks
266
286
 
@@ -271,20 +291,26 @@ import { site } from "virtual:compiiile"
271
291
 
272
292
  ## Contributing
273
293
 
274
- Contributions are welcome after discussing the object of your contribution in the `Issues` pages (because the goal is to keep this project really simple and straightforward).
294
+ Contributions are welcome after discussing the object of your contribution in the `Issues` pages (because the goal is to
295
+ keep this project really simple and straightforward).
275
296
 
276
297
  You can read more about it and the roadmap in the [dedicated contributing guide](./CONTRIBUTING.md).
277
298
 
278
299
  ## Community projects
279
300
 
280
301
  Here is a list of projects related to Compiiile developed by the community:
281
- - [compiiile-actions-cloudflare-pages](https://github.com/marketplace/actions/compiiile-cloudflare-pages): A simple GitHub action to deploy a Compiiile site to CloudFlare pages
302
+
303
+ - [compiiile-actions-cloudflare-pages](https://github.com/marketplace/actions/compiiile-cloudflare-pages): A simple
304
+ GitHub action to deploy a Compiiile site to CloudFlare pages
282
305
 
283
306
  ## Support
284
307
 
285
- Open-source is a wonderful thing, so please if you found this project useful or use it as a part of a commercial project, **consider making a donation**.
286
- You can do it either via [GitHub donations](https://github.com/sponsors/AlbanCrepel) or via [my ko-fi page](https://ko-fi.com/alban_crepel) where you can make a one-time or monthly donation by PayPal or card.
287
- This allows you to use Compiiile as a **pay-what-you-want** service if you are not part of a non-profit project. But if you are **making any revenue** using this project or even use it as a trainer, **making a donation would be expected**.
308
+ Open-source is a wonderful thing, so please if you found this project useful or use it as a part of a commercial
309
+ project, **consider making a donation**.
310
+ You can do it either via [GitHub donations](https://github.com/sponsors/AlbanCrepel) or
311
+ via [my ko-fi page](https://ko-fi.com/alban_crepel) where you can make a one-time or monthly donation by PayPal or card.
312
+ This allows you to use Compiiile as a **pay-what-you-want** service if you are not part of a non-profit project. But if
313
+ you are **making any revenue** using this project or even use it as a trainer, **making a donation would be expected**.
288
314
  You can always contact me for a custom use of this project and any licence issue.
289
315
 
290
316
  Thank you :heart:
package/bin/config.js CHANGED
@@ -50,6 +50,8 @@ process.env.VITE_COMPIIILE_DESCRIPTION = argv.description ?? ""
50
50
 
51
51
  process.env.VITE_COMPIIILE_LOGO_URL = argv.logoUrl ?? ""
52
52
 
53
+ process.env.VITE_COMPIIILE_THEME = argv.theme ?? "auto"
54
+
53
55
  process.env.VITE_COMPIIILE_DATA = JSON.stringify(argv.data ?? {})
54
56
 
55
57
  // Handling logo and favicon
@@ -27,7 +27,8 @@ export default class {
27
27
  logoUrl: process.env.VITE_COMPIIILE_LOGO_URL !== "" ? process.env.VITE_COMPIIILE_LOGO_URL : undefined,
28
28
  siteUrl: process.env.VITE_COMPIIILE_SITE_URL !== "" ? process.env.VITE_COMPIIILE_SITE_URL : undefined,
29
29
  base: process.env.VITE_COMPIIILE_BASE,
30
- data: JSON.parse(process.env.VITE_COMPIIILE_DATA)
30
+ data: JSON.parse(process.env.VITE_COMPIIILE_DATA),
31
+ theme: process.env.VITE_COMPIIILE_THEME
31
32
  }
32
33
  }
33
34
 
@@ -115,7 +116,6 @@ export default class {
115
116
 
116
117
  const meta = renderedMarkdown.metadata.frontmatter
117
118
 
118
-
119
119
  fileListItem.title = meta.title || fileName
120
120
  fileListItem.meta = meta
121
121
  fileListItem.meta.title = fileListItem.meta.title || fileListItem.title