Skip to content

Commit

Permalink
First version of developer docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Corb3nik committed Sep 8, 2024
0 parents commit 628aa33
Show file tree
Hide file tree
Showing 41 changed files with 4,146 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"postCreateCommand": "npm install -g pnpm && pnpm install",
"postStartCommand": "pnpm dev",
"features": {
"ghcr.io/devcontainers-contrib/features/pnpm:2": {},
"ghcr.io/devcontainers-contrib/features/markdownlint-cli2:1": {}
},
"customizations": {
"vscode": {
"extensions": [
"DavidAnson.vscode-markdownlint",
"esbenp.prettier-vscode"
]
}
}
}
27 changes: 27 additions & 0 deletions .github/workflows/compress-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Compress Images
on:
pull_request:
paths:
- '**.jpg'
- '**.jpeg'
- '**.png'
- '**.webp'

concurrency:
group: compress-images-${{ github.ref_name }}
cancel-in-progress: true

jobs:
run:
# Only run on Pull Requests within the same repository, and not from forks.
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Compress Images
uses: calibreapp/image-actions@04831e32337cfbe14b4b2952e5c4aac651f32ec5
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Lint
on:
pull_request:
paths:
- '**.md'

concurrency:
group: lint-${{ github.ref_name }}
cancel-in-progress: true

env:
CAIDO_PNPM_VERSION: 9


jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Lint
uses: DavidAnson/markdownlint-cli2-action@510b996878fc0d1a46c8a04ec86b06dbfba09de7 # v15
with:
globs: '**/*.md'

build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: ${{ env.CAIDO_PNPM_VERSION }}

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run build
run: pnpm build


7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
book
bin
.DS_Store

.vitepress/dist
.vitepress/cache
node_modules/
10 changes: 10 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"no-inline-html": false,
"line-length": false,
"first-line-heading": false,
"single-title": false,
"fenced-code-language": false,
"no-duplicate-heading": false,
"ol-prefix": false,
"no-trailing-punctuation": false
}
33 changes: 33 additions & 0 deletions .vitepress/components/Pro.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<script setup lang="ts">
</script>

<template>
<div class="c-pro info custom-block">
<slot name="title">
<p class="custom-block-title">⚡PRO FEATURE</p>
</slot>
<p>
<slot>
</slot>
</p>
</div>
</template>

<style scoped>
.c-pro {
position: relative;
backdrop-filter: blur(10px);
}
.c-pro::before {
content: "";
position: absolute;
inset: 0;
border-radius: 8px;
border: 2px solid transparent;
background: linear-gradient(140deg, var(--vp-c-brand-1), var(--vp-c-brand-2)) border-box;
mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
mask-composite: exclude;
}
</style>
51 changes: 51 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { defineConfig } from 'vitepress'

import { referenceSidebar, guidesSidebar, conceptsSidebar } from './sidebars'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Caido",
titleTemplate: "Developer",
description: "Official Caido Developer Documentation",

srcDir: 'src',
appearance: "force-dark",
sitemap: {
hostname: "https://developer.caido.io"
},

head: [
['link', { rel: 'icon', href: '/favicon.png' }],
["script", { "data-api": "/stats/event", src: "/stats/script.js", "defer":"", "data-domain":"developer.caido.io" }]
],
ignoreDeadLinks: "localhostLinks",

themeConfig: {
logo: {
src: '/logo.png',
"no-shadow": true,
},

search: {
provider: 'local',
},

nav: [
{ text: 'Guides', link: '/guides/' },
{ text: 'Reference', link: '/reference/' },
{ text: 'Concepts', link: '/concepts/' },
],

sidebar: {
'/reference/': referenceSidebar,
'/guides/': guidesSidebar,
'/concepts/': conceptsSidebar,
},

socialLinks: [
{ icon: 'discord', link: 'https://links.caido.io/discord' },
{ icon: 'twitter', link: 'https://twitter.com/caidoio' },
{ icon: 'github', link: 'https://github.com/caido/caido' },
]
}
})
36 changes: 36 additions & 0 deletions .vitepress/sidebars/concepts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { DefaultTheme } from "vitepress";

export const conceptsSidebar: DefaultTheme.SidebarItem[] = [
{
text: "Introduction",
items: [
{
text: "Directory",
link: "/concepts/",
},
],
},
{
text: "Essentials",
items: [
{
text: "Plugins",
link: "/concepts/essentials/plugins/",
items: [
{
text: "Frontend",
link: "/concepts/essentials/plugins/frontend",
},
{
text: "(WIP) Backend",
link: "/concepts/essentials/plugins/backend",
},
],
},
{
text: "Tooling",
link: "/concepts/essentials/tooling",
},
],
},
];
44 changes: 44 additions & 0 deletions .vitepress/sidebars/guides.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { DefaultTheme } from "vitepress";

export const guidesSidebar: DefaultTheme.SidebarItem[] = [
{
text: "Introduction",
items: [
{
text: "Directory",
link: "/guides/",
},
],
},
{
text: "Example plugins",
items: [
{
text: "Notebook",
link: "/guides/plugins/notebook"
},
],
},
{
text: "Distribution",
items: [
{
text: "Submitting a Plugin",
link: "/guides/distribution/submitting_a_plugin",
},
{
text: "Developer Policy",
link: "/guides/distribution/developer_policy",
}
]
},
{
text: "Contributions",
items: [
{
text: "Documentation",
link: "/guides/contributions/documentation",
},
],
},
];
3 changes: 3 additions & 0 deletions .vitepress/sidebars/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./reference";
export * from "./guides";
export * from "./concepts";
42 changes: 42 additions & 0 deletions .vitepress/sidebars/reference.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import {
DefaultTheme
} from "vitepress";

export const referenceSidebar: DefaultTheme.SidebarItem[] = [{
text: "Introduction",
items: [{
text: 'Directory',
link: '/reference/'
},
]
},
{
text: 'Plugins',
items: [{
text: 'Custom CSS',
link: '/reference/plugins/custom_css'
},
{
text: '(WIP) Custom JS',
link: '/reference/plugins/custom_js'
},
{
text: '(WIP) Custom Workflow Nodes',
link: '/reference/plugins/custom_workflow_nodes'
}
]
},
{
text: 'SDKs',
items: [
{
text: 'Backend',
link: '/reference/sdks/backend_sdk',
},
{
text: 'Frontend (WIP)',
link: '/reference/sdks/frontend_sdk',
},
]
},
]
Loading

0 comments on commit 628aa33

Please sign in to comment.