Skip to content

Commit 71fb0e0

Browse files
authored
Dev doc move (#123)
* Remove Plugin doc * Add eslint * Add more backlinks * Run lint on js * Fix lint glob
1 parent 1a7719b commit 71fb0e0

32 files changed

+1563
-1350
lines changed

.github/workflows/validate.yml

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
name: Lint
1+
name: Lint & Build
22
on:
33
pull_request:
4-
paths:
5-
- '**.md'
64

75
concurrency:
8-
group: lint-${{ github.ref_name }}
6+
group: validate-${{ github.ref_name }}
97
cancel-in-progress: true
108

119
env:
1210
CAIDO_PNPM_VERSION: 9
1311

14-
1512
jobs:
1613
lint:
1714
runs-on: ubuntu-latest
@@ -20,10 +17,21 @@ jobs:
2017
- name: Checkout Repo
2118
uses: actions/checkout@v4
2219

23-
- name: Lint
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v4
22+
with:
23+
version: ${{ env.CAIDO_PNPM_VERSION }}
24+
25+
- name: Install dependencies
26+
run: pnpm install --frozen-lockfile
27+
28+
- name: Lint Markdown
2429
uses: DavidAnson/markdownlint-cli2-action@510b996878fc0d1a46c8a04ec86b06dbfba09de7 # v15
2530
with:
26-
globs: '**/*.md'
31+
globs: 'src/**/*.md'
32+
33+
- name: Lint JS
34+
run: pnpm lint:js
2735

2836
build:
2937
runs-on: ubuntu-latest
@@ -33,7 +41,7 @@ jobs:
3341
uses: actions/checkout@v4
3442

3543
- name: Setup pnpm
36-
uses: pnpm/action-setup@v3.0.0
44+
uses: pnpm/action-setup@v4
3745
with:
3846
version: ${{ env.CAIDO_PNPM_VERSION }}
3947

@@ -42,5 +50,3 @@ jobs:
4250

4351
- name: Run build
4452
run: pnpm build
45-
46-

.vitepress/components/Pro.vue

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
<script setup lang="ts">
2-
</script>
1+
<script setup lang="ts"></script>
32

43
<template>
5-
<div class="c-pro info custom-block">
6-
<slot name="title">
7-
<p class="custom-block-title">⚡PRO FEATURE</p>
8-
</slot>
9-
<p>
10-
<slot>
4+
<div class="c-pro info custom-block">
5+
<slot name="title">
6+
<p class="custom-block-title">⚡PRO FEATURE</p>
117
</slot>
12-
</p>
13-
</div>
8+
<p>
9+
<slot />
10+
</p>
11+
</div>
1412
</template>
1513

1614
<style scoped>
@@ -25,9 +23,11 @@
2523
inset: 0;
2624
border-radius: 8px;
2725
border: 2px solid transparent;
28-
background: linear-gradient(140deg, var(--vp-c-brand-1), var(--vp-c-brand-2)) border-box;
29-
mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
26+
background: linear-gradient(140deg, var(--vp-c-brand-1), var(--vp-c-brand-2))
27+
border-box;
28+
mask:
29+
linear-gradient(#fff 0 0) padding-box,
30+
linear-gradient(#fff 0 0);
3031
mask-composite: exclude;
3132
}
32-
3333
</style>

.vitepress/config.mts

+37-24
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,68 @@
1-
import { defineConfig } from 'vitepress'
1+
import { defineConfig } from "vitepress";
22

3-
import { quickstartSidebar, referenceSidebar, guidesSidebar, conceptsSidebar } from './sidebars'
3+
import {
4+
conceptsSidebar,
5+
guidesSidebar,
6+
quickstartSidebar,
7+
referenceSidebar,
8+
} from "./sidebars";
49

510
// https://vitepress.dev/reference/site-config
611
export default defineConfig({
712
title: "Caido",
813
titleTemplate: "Documentation",
914
description: "Official Caido Documentation",
1015

11-
srcDir: 'src',
16+
srcDir: "src",
1217
appearance: "force-dark",
1318
sitemap: {
14-
hostname: "https://docs.caido.io"
19+
hostname: "https://docs.caido.io",
1520
},
1621

1722
head: [
18-
['link', { rel: 'icon', href: '/favicon.png' }],
19-
["script", { "data-api": "/stats/event", src: "/stats/script.js", "defer":"", "data-domain":"docs.caido.io" }]
23+
["link", { rel: "icon", href: "/favicon.png" }],
24+
[
25+
"script",
26+
{
27+
"data-api": "/stats/event",
28+
src: "/stats/script.js",
29+
defer: "",
30+
"data-domain": "docs.caido.io",
31+
},
32+
],
2033
],
2134
ignoreDeadLinks: "localhostLinks",
2235

2336
themeConfig: {
2437
logo: {
25-
src: '/logo.png',
38+
src: "/logo.png",
2639
"no-shadow": true,
2740
},
2841

2942
search: {
30-
provider: 'local',
43+
provider: "local",
3144
},
3245

3346
nav: [
34-
{ text: 'Quickstart', link: '/quickstart/' },
35-
{ text: 'Guides', link: '/guides/' },
36-
{ text: 'Reference', link: '/reference/' },
37-
{ text: 'Concepts', link: '/concepts/' },
38-
{ text: 'FAQ', link: '/faq' },
39-
{ text: "Report a Bug", link: "/report_bug" }
47+
{ text: "Quickstart", link: "/quickstart/" },
48+
{ text: "Guides", link: "/guides/" },
49+
{ text: "Reference", link: "/reference/" },
50+
{ text: "Concepts", link: "/concepts/" },
51+
{ text: "FAQ", link: "/faq" },
52+
{ text: "Report a Bug", link: "/report_bug" },
4053
],
4154

4255
sidebar: {
43-
'/quickstart/': quickstartSidebar,
44-
'/reference/': referenceSidebar,
45-
'/guides/': guidesSidebar,
46-
'/concepts/': conceptsSidebar,
56+
"/quickstart/": quickstartSidebar,
57+
"/reference/": referenceSidebar,
58+
"/guides/": guidesSidebar,
59+
"/concepts/": conceptsSidebar,
4760
},
4861

4962
socialLinks: [
50-
{ icon: 'discord', link: 'https://links.caido.io/discord' },
51-
{ icon: 'twitter', link: 'https://twitter.com/caidoio' },
52-
{ icon: 'github', link: 'https://github.com/caido/caido' },
53-
]
54-
}
55-
})
63+
{ icon: "discord", link: "https://links.caido.io/discord" },
64+
{ icon: "twitter", link: "https://twitter.com/caidoio" },
65+
{ icon: "github", link: "https://github.com/caido/caido" },
66+
],
67+
},
68+
});

.vitepress/sidebars/concepts.ts

+5-44
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DefaultTheme } from "vitepress";
1+
import type { DefaultTheme } from "vitepress";
22

33
export const conceptsSidebar: DefaultTheme.SidebarItem[] = [
44
{
@@ -49,49 +49,6 @@ export const conceptsSidebar: DefaultTheme.SidebarItem[] = [
4949
},
5050
],
5151
},
52-
{
53-
text: "Plugins",
54-
items: [
55-
{
56-
text: "Basics",
57-
link: "/concepts/plugins/plugin_basics",
58-
items: [
59-
{
60-
text: "Frontend",
61-
link: "/concepts/plugins/frontend",
62-
},
63-
{
64-
text: "(WIP) Backend",
65-
link: "/concepts/plugins/backend",
66-
},
67-
],
68-
},
69-
{
70-
text: "Tooling",
71-
link: "/concepts/plugins/plugin_tooling",
72-
items: [
73-
{
74-
text: "(WIP) SDK Frontend",
75-
link: "/concepts/plugins/frontend_sdk",
76-
},
77-
{
78-
text: "(WIP) SDK Backend",
79-
link: "/concepts/plugins/backend_sdk",
80-
},
81-
],
82-
},
83-
{
84-
text: "Store",
85-
link: "/concepts/plugins/store",
86-
items: [
87-
{
88-
text: "Developer Policy",
89-
link: "/concepts/plugins/developer_policy",
90-
},
91-
],
92-
},
93-
],
94-
},
9552
{
9653
text: "Internals",
9754
items: [
@@ -115,6 +72,10 @@ export const conceptsSidebar: DefaultTheme.SidebarItem[] = [
11572
text: "Authentication",
11673
link: "/concepts/internals/authentication",
11774
},
75+
{
76+
text: "Developer",
77+
link: "https://developer.caido.io",
78+
},
11879
],
11980
},
12081
];

.vitepress/sidebars/guides.ts

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DefaultTheme } from "vitepress";
1+
import type { DefaultTheme } from "vitepress";
22

33
export const guidesSidebar: DefaultTheme.SidebarItem[] = [
44
{
@@ -31,15 +31,6 @@ export const guidesSidebar: DefaultTheme.SidebarItem[] = [
3131
},
3232
],
3333
},
34-
{
35-
text: "Plugins",
36-
items: [
37-
{
38-
text: "Notebook",
39-
link: "/guides/plugins/notebook"
40-
},
41-
],
42-
},
4334
{
4435
text: "Workflows",
4536
items: [

.vitepress/sidebars/quickstart.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DefaultTheme } from "vitepress";
1+
import type { DefaultTheme } from "vitepress";
22

33
export const quickstartSidebar: DefaultTheme.SidebarItem[] = [
44
{

0 commit comments

Comments
 (0)