@compiiile/compiiile 2.2.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/public/favicon.png +0 -0
- package/.compiiile/src/app.js +5 -0
- package/.compiiile/src/components/ClientScript.vue +48 -0
- package/.compiiile/src/components/ContentWrapper.vue +288 -0
- package/.compiiile/src/components/SlidesContent.vue +56 -0
- package/.compiiile/src/components/TableOfContent.vue +65 -0
- package/.compiiile/src/components/layout/HamburgerButton.vue +90 -0
- package/.compiiile/src/components/layout/TopBar.vue +106 -0
- package/.compiiile/src/components/layout/navBar/FilesTree.vue +35 -0
- package/.compiiile/src/components/layout/navBar/NavBar.vue +48 -0
- package/.compiiile/src/components/layout/navBar/NavListItem.vue +216 -0
- package/.compiiile/src/components/searchBar/SearchBar.vue +371 -0
- package/.compiiile/src/components/searchBar/SearchResult.vue +98 -0
- package/.compiiile/src/env.d.ts +1 -0
- package/.compiiile/src/layouts/BaseLayout.astro +38 -0
- package/.compiiile/src/layouts/SlidesLayout.astro +12 -0
- package/.compiiile/src/layouts/WorkspaceLayout.astro +58 -0
- package/.compiiile/src/pages/404.astro +17 -0
- package/.compiiile/src/pages/[...path].astro +61 -0
- package/.compiiile/src/style/code-theme.scss +30 -0
- package/.compiiile/src/style/index.scss +36 -0
- package/.compiiile/src/style/layouts.scss +43 -0
- package/.compiiile/src/style/print.scss +80 -0
- package/.compiiile/src/style/slides.scss +79 -0
- package/.compiiile/src/style/texts.scss +92 -0
- package/.compiiile/src/style/variables.scss +47 -0
- package/.compiiile/src/utils/searchIndex.js +28 -0
- package/.compiiile/src/utils/styles.js +9 -0
- package/.eslintrc.cjs +15 -0
- package/.github/FUNDING.yml +2 -0
- package/.prettierignore +1 -0
- package/.prettierrc.json +9 -0
- package/CHANGELOG.md +25 -0
- package/CONTRIBUTING.md +31 -0
- package/LICENCE.md +674 -0
- package/README.md +273 -0
- package/bin/cli.js +5 -0
- package/bin/config.js +137 -0
- package/bin/vitePluginCompiiile/index.js +32 -0
- package/bin/vitePluginCompiiile/markdownConfig.js +30 -0
- package/bin/vitePluginCompiiile/models/Context.js +138 -0
- package/bin/vitePluginCompiiile/models/FileListItem.js +10 -0
- package/bin/vitePluginCompiiile/models/FilesTreeItem.js +8 -0
- package/bin/vitePluginCompiiile/models/RouteListItem.js +9 -0
- package/bin/vitePluginCompiiile/rehypeHandleYamlMatterPlugin.js +8 -0
- package/bin/vitePluginCompiiile/rehypeImagePlugin.js +51 -0
- package/bin/vitePluginCompiiile/rehypeLinkPlugin.js +20 -0
- package/build.js +16 -0
- package/compiiile.config.js +6 -0
- package/dist/style.css +1 -0
- package/markdown-preview.md +242 -0
- package/package.json +81 -0
- package/slides-preview.mdx +39 -0
- package/src/env.d.ts +1 -0
- package/tsconfig.json +6 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { fileList } from "virtual:compiiile"
|
|
2
|
+
import { Fzf } from "fzf"
|
|
3
|
+
|
|
4
|
+
const fileParagraphs = fileList
|
|
5
|
+
.reduce((accumulator, currentValue) => {
|
|
6
|
+
const splitter = "\n"
|
|
7
|
+
const paragraphs = currentValue.textContent.split(splitter)
|
|
8
|
+
|
|
9
|
+
let currentIndex = 0
|
|
10
|
+
|
|
11
|
+
for (const paragraph of paragraphs) {
|
|
12
|
+
accumulator.push({
|
|
13
|
+
uuid: currentValue.uuid,
|
|
14
|
+
paragraph,
|
|
15
|
+
startIndex: currentIndex,
|
|
16
|
+
endIndex: currentIndex + paragraph.length
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
currentIndex += paragraph.length + splitter.length
|
|
20
|
+
}
|
|
21
|
+
return accumulator
|
|
22
|
+
}, [])
|
|
23
|
+
.filter((paragraph) => paragraph.paragraph)
|
|
24
|
+
|
|
25
|
+
export const searchIndex = new Fzf(fileParagraphs, {
|
|
26
|
+
selector: (item) => item.paragraph,
|
|
27
|
+
fuzzy: false
|
|
28
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "../style/index.scss"
|
|
2
|
+
/* Importing global fonts */
|
|
3
|
+
import "@fontsource-variable/archivo/wdth.css"
|
|
4
|
+
import "@fontsource-variable/archivo/wdth-italic.css"
|
|
5
|
+
import "@fontsource-variable/dm-sans"
|
|
6
|
+
import "@fontsource-variable/dm-sans/wght-italic.css"
|
|
7
|
+
import "@fontsource-variable/jetbrains-mono"
|
|
8
|
+
import "@fontsource-variable/jetbrains-mono/wght-italic.css"
|
|
9
|
+
/* -------------------- */
|
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
node: true
|
|
4
|
+
},
|
|
5
|
+
parserOptions: {
|
|
6
|
+
ecmaVersion: 12,
|
|
7
|
+
parser: "@babel/eslint-parser",
|
|
8
|
+
requireConfigFile: false,
|
|
9
|
+
sourceType: "module"
|
|
10
|
+
},
|
|
11
|
+
extends: ["eslint:recommended", "plugin:vue/vue3-recommended", "prettier"],
|
|
12
|
+
rules: {
|
|
13
|
+
"vue/no-v-html": 0
|
|
14
|
+
}
|
|
15
|
+
}
|
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dist/style.css
|
package/.prettierrc.json
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Upgrading from v1 to v2
|
|
4
|
+
|
|
5
|
+
v2 now uses Astro under the hood !
|
|
6
|
+
|
|
7
|
+
**:fire: New features**:
|
|
8
|
+
|
|
9
|
+
- :tada: Added MDX support
|
|
10
|
+
- :zap: Added Hot Reload support
|
|
11
|
+
|
|
12
|
+
**:wrench: Fix**:
|
|
13
|
+
|
|
14
|
+
- No more Markdown markup on search results
|
|
15
|
+
|
|
16
|
+
**:warning: Breaking changes**:
|
|
17
|
+
|
|
18
|
+
- Config file should now use ESM syntax:
|
|
19
|
+
The file should use `export default {}` instead of `module.exports = {}`
|
|
20
|
+
- No more route hash:
|
|
21
|
+
What was before `https://compiiile.me/#/c/markdown-preview` is now `https://compiiile.me/c/markdown-preview`
|
|
22
|
+
- No more dynamic section hash on page scroll
|
|
23
|
+
- Images size use a new syntax:
|
|
24
|
+
The new syntax must be in the image's `alt` attribute, preceded by a `pipe`: `` (the value can be in `px` or `%` and represents the image's width).
|
|
25
|
+
If no margin must be applied, a special attribute can be added like so: ``
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Contributions are welcome in this project, and they will be appreciated. But they **_must_** come **_after_** discussing it by creating an issue.
|
|
4
|
+
|
|
5
|
+
**Not all** contributions will be accepted. The goal of Compiiile is not to reproduce existing projects and add a lot of features to cover all use cases.
|
|
6
|
+
|
|
7
|
+
Whether, we will always aim to keep the code base and features simple.
|
|
8
|
+
|
|
9
|
+
## Roadmap
|
|
10
|
+
|
|
11
|
+
Here is the current roadmap and feature ideas for incoming releases:
|
|
12
|
+
|
|
13
|
+
- [ ] being able to resize the navbar
|
|
14
|
+
- [ ] tag files with frontmatter and search files having specific tags
|
|
15
|
+
- [ ] Make a theme switcher and make custom themes available to others (load external CSS)
|
|
16
|
+
- [ ] rewrite the whole thing in TypeScript and use Tailwind if I am ever motivated
|
|
17
|
+
- [ ] add some remark plugins (Mermaid ? Any ideas from you ?)
|
|
18
|
+
|
|
19
|
+
If a fix needs to be done or your contributing idea is part of this roadmap, it will most likely be taken into account.
|
|
20
|
+
|
|
21
|
+
People should also understand that I am not working full-time on this project and that deadlines will never be set for a feature to be implemented.
|
|
22
|
+
|
|
23
|
+
## Launching the project locally
|
|
24
|
+
|
|
25
|
+
You can launch a local version of the project by cloning the repository, installing the dependencies (with `yarn install`, and use these 3 commands):
|
|
26
|
+
|
|
27
|
+
- `yarn dev`
|
|
28
|
+
- `yarn build`
|
|
29
|
+
- `yarn preview`
|
|
30
|
+
|
|
31
|
+
Your code should also comply with the project's code style by running `yarn lint` and `yarn format`.
|