Skip to content

Commit dd65436

Browse files
authored
docs: migrate to vitepress (#350)
Replaces the documentation generator that is used for flow. Instead of using docsify, we are now using vitepress. This change was made to resolve some ongoing issues with SEO and AI site searches that was not possible with the docsify javascript.
1 parent c560528 commit dd65436

Some content is hidden

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

65 files changed

+3145
-662
lines changed

.execs/build.flow

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ executables:
4040
execs:
4141
- cmd: go run ./tools/docsgen/.
4242
- cmd: ./scripts/completions.sh
43-
# HACK: Copy the index.html to 404.html GitHub Pages redirect with the history router
44-
- cmd: cp docs/index.html docs/404.html
4543

4644
- verb: generate
4745
name: cli

.execs/docs.flow

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,6 @@
22
visibility: public
33
tags: [docs]
44
executables:
5-
- verb: start
6-
name: site
7-
aliases: [docs]
8-
description: Run the documentation site locally (from prerendered content)
9-
serial:
10-
dir: //
11-
execs:
12-
- ref: build docs
13-
- cmd: npx serve dist -l 3000
14-
15-
- verb: start
16-
name: docsify
17-
description: Run the documentation site locally using the docsify CLI
18-
exec:
19-
dir: //
20-
cmd: docsify serve docs --open
21-
22-
- verb: build
23-
name: docs
24-
description: Prerender docsify documentation site for the project
25-
exec:
26-
dir: //
27-
cmd:
28-
node ./scripts/prerender.js
29-
305
- verb: show
316
name: flowfile
327
aliases: [executables, exec, executable]

desktop/scripts/generate-rust-types.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -euo pipefail
33

4-
SCHEMAS_DIR="../docs/schemas"
4+
SCHEMAS_DIR="../docs/public/schemas"
55
OUTPUT_DIR="src-tauri/src/types/generated"
66

77
mkdir -p "$OUTPUT_DIR"

desktop/scripts/generate-ts-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import fs from "fs/promises";
55
import { compile } from "json-schema-to-typescript";
66
import path from "path";
77

8-
const SCHEMAS_DIR = path.resolve(process.cwd(), "../docs/schemas");
8+
const SCHEMAS_DIR = path.resolve(process.cwd(), "../docs/public/schemas");
99
const OUTPUT_DIR = path.resolve(process.cwd(), "src/types/generated");
1010

1111
async function generateTypes() {

desktop/src-tauri/src/types/generated/template.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ impl ::std::default::Default for FieldType {
373373
#[doc = " }"]
374374
#[doc = " },"]
375375
#[doc = " \"form\": {"]
376-
#[doc = " \"description\": \"Form fields to be displayed to the user when generating a flow file from a template. \\nThe form will be rendered first, and the user's input can be used to render the template.\\nFor example, a form field with the key `name` can be used in the template as `{{.name}}`.\\n\","]
376+
#[doc = " \"description\": \"Form fields to be displayed to the user when generating a flow file from a template. \\nThe form will be rendered first, and the user's input can be used to render the template.\\n\","]
377377
#[doc = " \"default\": [],"]
378378
#[doc = " \"type\": \"array\","]
379379
#[doc = " \"items\": {"]
@@ -407,7 +407,7 @@ pub struct Template {
407407
#[doc = "A list of artifacts to be copied after generating the flow file."]
408408
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
409409
pub artifacts: ::std::vec::Vec<Artifact>,
410-
#[doc = "Form fields to be displayed to the user when generating a flow file from a template. \nThe form will be rendered first, and the user's input can be used to render the template.\nFor example, a form field with the key `name` can be used in the template as `{{.name}}`.\n"]
410+
#[doc = "Form fields to be displayed to the user when generating a flow file from a template. \nThe form will be rendered first, and the user's input can be used to render the template.\n"]
411411
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
412412
pub form: ::std::vec::Vec<Field>,
413413
#[doc = "A list of exec executables to run after generating the flow file."]

desktop/src/types/generated/template.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export interface Template {
1414
/**
1515
* Form fields to be displayed to the user when generating a flow file from a template.
1616
* The form will be rendered first, and the user's input can be used to render the template.
17-
* For example, a form field with the key `name` can be used in the template as `{{.name}}`.
1817
*
1918
*/
2019
form?: Field[];

docs/.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Astro / Starlight
2+
node_modules/
3+
.dist/
4+
.next/
5+
.DS_Store
6+
.vitepress/cache
7+
.vitepress/dist/
8+
dist/
9+
.env
10+
.env.*
11+
# Pagefind search index
12+
pagefind/

docs/.nojekyll

Whitespace-only changes.

docs/.vitepress/config.mts

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
import { defineConfig } from 'vitepress'
2+
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
3+
4+
// https://vitepress.dev/reference/site-config
5+
export default defineConfig({
6+
title: "flow",
7+
description: "Local developer automation platform that flows with you.",
8+
base: '/',
9+
outDir: './dist',
10+
11+
head: [
12+
['link', { rel: 'icon', href: '/favicon.ico' }]
13+
],
14+
15+
markdown: {
16+
config(md) {
17+
md.use(tabsMarkdownPlugin)
18+
},
19+
},
20+
21+
themeConfig: {
22+
logo: {
23+
light: '/logo-light.png',
24+
dark: '/logo-dark.png'
25+
},
26+
27+
siteTitle: false,
28+
29+
nav: [
30+
{ text: 'Home', link: '/' },
31+
{ text: 'Guides', link: '/guides/', activeMatch: '/guides/'},
32+
{ text: 'CLI Reference', link: '/cli/', activeMatch: '/cli/' },
33+
{ text: 'Config Reference', link: '/types/', activeMatch: '/types/' }
34+
],
35+
36+
sidebar: {
37+
'/guides/': [
38+
{
39+
text: 'User Guides',
40+
items: [
41+
{ text: 'Overview', link: '/guides/' },
42+
{ text: 'Getting Started',
43+
items: [
44+
{ text: 'Concepts', link: '/guides/concepts' },
45+
{ text: 'Your First Workflow', link: '/guides/first-workflow' },
46+
]
47+
},
48+
{ text: 'Essentials',
49+
items: [
50+
{ text: 'Executables', link: '/guides/executables' },
51+
{ text: 'Workspaces', link: '/guides/workspaces' },
52+
{ text: 'Secrets', link: '/guides/secrets' },
53+
]},
54+
{ text: 'Advanced',
55+
items: [
56+
{ text: 'Imported Executables', link: '/guides/generated-config' },
57+
{ text: 'Templates & Workflow Generation', link: '/guides/templating' },
58+
{ text: 'Advanced Workflows', link: '/guides/advanced' },
59+
{ text: 'Interactive UI', link: '/guides/interactive' },
60+
{ text: 'Integrations', link: '/guides/integrations' },
61+
]},
62+
]
63+
}
64+
],
65+
'/cli/': [
66+
{
67+
text: 'CLI Reference',
68+
items: [
69+
{ text: 'Overview', link: '/cli/flow' },
70+
{ text: 'flow browse', link: '/cli/flow_browse' },
71+
{ text: 'flow exec', link: '/cli/flow_exec' },
72+
{ text: 'flow logs', link: '/cli/flow_logs' },
73+
{ text: 'flow mcp', link: '/cli/flow_mcp' },
74+
{ text: 'flow sync', link: '/cli/flow_sync' },
75+
{
76+
text: 'Cache',
77+
collapsed: true,
78+
items: [
79+
{ text: 'flow cache', link: '/cli/flow_cache' },
80+
{ text: 'flow cache clear', link: '/cli/flow_cache_clear' },
81+
{ text: 'flow cache get', link: '/cli/flow_cache_get' },
82+
{ text: 'flow cache list', link: '/cli/flow_cache_list' },
83+
{ text: 'flow cache remove', link: '/cli/flow_cache_remove' },
84+
{ text: 'flow cache set', link: '/cli/flow_cache_set' }
85+
]
86+
},
87+
{
88+
text: 'Config',
89+
collapsed: true,
90+
items: [
91+
{ text: 'flow config', link: '/cli/flow_config' },
92+
{ text: 'flow config get', link: '/cli/flow_config_get' },
93+
{ text: 'flow config reset', link: '/cli/flow_config_reset' },
94+
{ text: 'flow config set', link: '/cli/flow_config_set' },
95+
{ text: 'flow config set log-mode', link: '/cli/flow_config_set_log-mode' },
96+
{ text: 'flow config set namespace', link: '/cli/flow_config_set_namespace' },
97+
{ text: 'flow config set notifications', link: '/cli/flow_config_set_notifications' },
98+
{ text: 'flow config set theme', link: '/cli/flow_config_set_theme' },
99+
{ text: 'flow config set timeout', link: '/cli/flow_config_set_timeout' },
100+
{ text: 'flow config set tui', link: '/cli/flow_config_set_tui' },
101+
{ text: 'flow config set workspace', link: '/cli/flow_config_set_workspace' },
102+
{ text: 'flow config set workspace-mode', link: '/cli/flow_config_set_workspace-mode' }
103+
]
104+
},
105+
{
106+
text: 'Secret',
107+
collapsed: true,
108+
items: [
109+
{ text: 'flow secret', link: '/cli/flow_secret' },
110+
{ text: 'flow secret get', link: '/cli/flow_secret_get' },
111+
{ text: 'flow secret list', link: '/cli/flow_secret_list' },
112+
{ text: 'flow secret remove', link: '/cli/flow_secret_remove' },
113+
{ text: 'flow secret set', link: '/cli/flow_secret_set' }
114+
]
115+
},
116+
{
117+
text: 'Template',
118+
collapsed: true,
119+
items: [
120+
{ text: 'flow template', link: '/cli/flow_template' },
121+
{ text: 'flow template add', link: '/cli/flow_template_add' },
122+
{ text: 'flow template generate', link: '/cli/flow_template_generate' },
123+
{ text: 'flow template get', link: '/cli/flow_template_get' },
124+
{ text: 'flow template list', link: '/cli/flow_template_list' }
125+
]
126+
},
127+
{
128+
text: 'Vault',
129+
collapsed: true,
130+
items: [
131+
{ text: 'flow vault', link: '/cli/flow_vault' },
132+
{ text: 'flow vault create', link: '/cli/flow_vault_create' },
133+
{ text: 'flow vault edit', link: '/cli/flow_vault_edit' },
134+
{ text: 'flow vault get', link: '/cli/flow_vault_get' },
135+
{ text: 'flow vault list', link: '/cli/flow_vault_list' },
136+
{ text: 'flow vault remove', link: '/cli/flow_vault_remove' },
137+
{ text: 'flow vault switch', link: '/cli/flow_vault_switch' }
138+
]
139+
},
140+
{
141+
text: 'Workspace',
142+
collapsed: true,
143+
items: [
144+
{ text: 'flow workspace', link: '/cli/flow_workspace' },
145+
{ text: 'flow workspace add', link: '/cli/flow_workspace_add' },
146+
{ text: 'flow workspace get', link: '/cli/flow_workspace_get' },
147+
{ text: 'flow workspace list', link: '/cli/flow_workspace_list' },
148+
{ text: 'flow workspace remove', link: '/cli/flow_workspace_remove' },
149+
{ text: 'flow workspace switch', link: '/cli/flow_workspace_switch' },
150+
{ text: 'flow workspace view', link: '/cli/flow_workspace_view' }
151+
]
152+
}
153+
]
154+
}
155+
],
156+
'/types/': [
157+
{
158+
text: 'Configuration Reference',
159+
items: [
160+
{ text: 'Overview', link: '/types/' },
161+
{ text: 'Config', link: '/types/config' },
162+
{ text: 'Flow File', link: '/types/flowfile' },
163+
{ text: 'Template', link: '/types/template' },
164+
{ text: 'Workspace', link: '/types/workspace' }
165+
]
166+
}
167+
],
168+
'/': [
169+
{
170+
text: 'Getting Started',
171+
items: [
172+
{ text: 'Installation', link: '/installation' },
173+
{ text: 'Quick Start', link: '/quickstart' }
174+
]
175+
},
176+
{
177+
text: 'More',
178+
items: [
179+
{ text: 'User Guides', link: '/guides/' },
180+
{ text: 'CLI Reference', link: '/cli/' },
181+
{ text: 'Configuration Reference', link: '/types/' },
182+
{ text: 'Contributing', link: '/development' },
183+
{ text: 'TUI Kit', link: '/tuikit' }
184+
]
185+
}
186+
]
187+
},
188+
189+
socialLinks: [
190+
{ icon: 'github', link: 'https://github.com/flowexec/flow' },
191+
{ icon: 'discord', link: 'https://discord.gg/CtByNKNMxM' }
192+
],
193+
194+
search: {
195+
provider: 'local'
196+
},
197+
198+
outline: {
199+
level: [2, 3]
200+
}
201+
}
202+
})

docs/.vitepress/theme/custom.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
:root {
2+
--vp-c-brand-1: #7FBBB3;
3+
--vp-c-brand-2: #83C092;
4+
--vp-c-brand-3: #D699B6;
5+
--vp-home-hero-name-color: #D699B6;
6+
}
7+
8+
/* Hero image glow effect */
9+
.VPHero .image-src {
10+
filter: drop-shadow(5px 5px 100px #D699B6);
11+
}
12+
13+
.VPHero .name {
14+
font-size: 1.8em !important;
15+
line-height: 1.8em !important;
16+
}
17+
18+
.VPHero .text {
19+
font-size: 3.2em !important;
20+
line-height: 1.2em !important;
21+
}
22+
23+
.VPHero .tagline {
24+
font-size: 1.4em !important;
25+
line-height: 1.8em !important;
26+
}

0 commit comments

Comments
 (0)