Skip to content

Commit 8c9a1ea

Browse files
committed
Add docs (#332)
1 parent ed1422c commit 8c9a1ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+13301
-0
lines changed

.github/workflows/build-docs.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Build Production Site
2+
3+
on:
4+
push:
5+
branches: [release/**/**]
6+
paths:
7+
- '**.md'
8+
9+
jobs:
10+
dispatch:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Trigger build
14+
run: curl -X POST -d {} "${{ secrets.CLOUDFLARE_BUILD_HOOK }}"

.github/workflows/tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: tests workflow
22

33
on:
4+
pull_request:
5+
paths-ignore:
6+
- "docs/**"
7+
- "samples/**"
8+
- "**.md"
9+
410
workflow_call:
511
inputs:
612
image:

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,7 @@ fabric.properties
173173

174174
# Generated certificates
175175
certs/
176+
177+
.temp
178+
.cache
179+
node_modules

docs/.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
!.vuepress/
2+
!.*.js
3+
.cache/
4+
.temp/
5+
node_modules/
6+
dist/

docs/.eslintrc.cjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
root: true,
3+
extends: 'vuepress',
4+
overrides: [
5+
{
6+
files: ['*.ts', '*.vue'],
7+
extends: 'vuepress-typescript',
8+
parserOptions: {
9+
project: ['tsconfig.json'],
10+
},
11+
},
12+
],
13+
}

docs/.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

docs/.vuepress/client.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type {Router} from "vue-router";
2+
3+
interface ClientConfig {
4+
enhance?: (context: {
5+
app: any;
6+
router: Router;
7+
siteData: any;
8+
}) => void | Promise<void>;
9+
setup?: () => void;
10+
}

docs/.vuepress/config.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { dl } from "@mdit/plugin-dl";
2+
import viteBundler from "@vuepress/bundler-vite";
3+
import vueDevTools from 'vite-plugin-vue-devtools'
4+
import { defineUserConfig } from "vuepress";
5+
import { hopeTheme } from "vuepress-theme-hope";
6+
import { themeOptions } from "./configs/theme";
7+
import { linkCheckPlugin } from "./markdown/linkCheck";
8+
import { replaceLinkPlugin } from "./markdown/replaceLink";
9+
10+
11+
export default defineUserConfig({
12+
base: "/",
13+
dest: "public",
14+
title: "Docs",
15+
description: "Event-native database",
16+
bundler: viteBundler({ viteOptions: { plugins: [vueDevTools(),], } }),
17+
markdown: { importCode: false },
18+
extendsMarkdown: md => {
19+
md.use(linkCheckPlugin);
20+
md.use(replaceLinkPlugin, {
21+
replaceLink: (link: string, _) => link
22+
.replace("@api", "/api")
23+
.replace("@server/", "/server/{version}/")
24+
});
25+
md.use(dl);
26+
},
27+
theme: hopeTheme(themeOptions, { custom: true }),
28+
});

docs/.vuepress/configs/theme.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import type {ThemeOptions} from "vuepress-theme-hope";
2+
3+
export const themeOptions: ThemeOptions = {
4+
logo: "/Kurrent Logo - Plum.svg",
5+
logoDark: "/Kurrent Logo - White.svg",
6+
docsDir: 'docs',
7+
editLink: false,
8+
lastUpdated: true,
9+
toc: true,
10+
repo: "https://github.com/kurrent-io",
11+
repoLabel: "GitHub",
12+
repoDisplay: true,
13+
contributors: false,
14+
pure: false,
15+
darkmode:"toggle",
16+
headerDepth: 3,
17+
pageInfo: false,
18+
markdown: {
19+
figure: true,
20+
imgLazyload: true,
21+
imgMark: true,
22+
imgSize: true,
23+
tabs: true,
24+
codeTabs: true,
25+
component: true,
26+
mermaid: true,
27+
highlighter: {
28+
type: "shiki",
29+
themes: {
30+
light: "one-light",
31+
dark: "one-dark-pro",
32+
}
33+
}
34+
}
35+
}
36+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const externalPlaceholders = ["@samples", "@clients"];
2+
3+
export function isKnownPlaceholder(placeholder: string): boolean {
4+
const known = externalPlaceholders.find(x => x == placeholder);
5+
return known !== undefined;
6+
}

0 commit comments

Comments
 (0)