|
1 | 1 | import { defineConfig } from "vitepress"; |
2 | 2 | import { execSync } from "node:child_process"; |
| 3 | +import { withMermaid } from "vitepress-plugin-mermaid"; |
3 | 4 |
|
4 | 5 | const inProd = process.env.NODE_ENV === "production"; |
5 | 6 |
|
@@ -28,103 +29,113 @@ const headers = inProd ? [baseHeaders, umamiScript] : baseHeaders; |
28 | 29 | const siteUrl = "https://codecompanion.olimorris.dev"; |
29 | 30 |
|
30 | 31 | // https://vitepress.dev/reference/site-config |
31 | | -export default defineConfig({ |
32 | | - title: "CodeCompanion", |
33 | | - description: "AI-powered coding, seamlessly in Neovim", |
34 | | - head: headers, |
35 | | - sitemap: { hostname: siteUrl }, |
36 | | - themeConfig: { |
37 | | - logo: "https://github.com/user-attachments/assets/825fc040-9bc8-4743-be2a-71e257f8a7be", |
38 | | - nav: [ |
39 | | - { |
40 | | - text: `${version}`, |
41 | | - items: [ |
42 | | - { |
43 | | - text: "Changelog", |
44 | | - link: "https://github.com/olimorris/codecompanion.nvim/blob/main/CHANGELOG.md", |
45 | | - }, |
46 | | - { |
47 | | - text: "Contributing", |
48 | | - link: "https://github.com/olimorris/codecompanion.nvim/blob/main/.github/contributing.md", |
49 | | - }, |
50 | | - ], |
51 | | - }, |
52 | | - ], |
| 32 | +export default withMermaid( |
| 33 | + defineConfig({ |
| 34 | + mermaid: { |
| 35 | + securityLevel: "loose", // Allows more flexibility |
| 36 | + theme: "base", // Use base theme to allow CSS variables to take effect |
| 37 | + }, |
| 38 | + // optionally set additional config for plugin itself with MermaidPluginConfig |
| 39 | + title: "CodeCompanion", |
| 40 | + description: "AI-powered coding, seamlessly in Neovim", |
| 41 | + head: headers, |
| 42 | + sitemap: { hostname: siteUrl }, |
| 43 | + themeConfig: { |
| 44 | + logo: "https://github.com/user-attachments/assets/825fc040-9bc8-4743-be2a-71e257f8a7be", |
| 45 | + nav: [ |
| 46 | + { |
| 47 | + text: `${version}`, |
| 48 | + items: [ |
| 49 | + { |
| 50 | + text: "Changelog", |
| 51 | + link: "https://github.com/olimorris/codecompanion.nvim/blob/main/CHANGELOG.md", |
| 52 | + }, |
| 53 | + { |
| 54 | + text: "Contributing", |
| 55 | + link: "https://github.com/olimorris/codecompanion.nvim/blob/main/.github/contributing.md", |
| 56 | + }, |
| 57 | + ], |
| 58 | + }, |
| 59 | + ], |
53 | 60 |
|
54 | | - sidebar: [ |
55 | | - { text: "Introduction", link: "/" }, |
56 | | - { text: "Installation", link: "/installation" }, |
57 | | - { text: "Getting Started", link: "/getting-started" }, |
58 | | - { |
59 | | - text: "Configuration", |
60 | | - collapsed: true, |
61 | | - items: [ |
62 | | - { text: "Introduction", link: "/configuration/introduction" }, |
63 | | - { text: "Action Palette", link: "/configuration/action-palette" }, |
64 | | - { text: "Adapters", link: "/configuration/adapters" }, |
65 | | - { text: "Chat Buffer", link: "/configuration/chat-buffer" }, |
66 | | - { text: "Inline Assistant", link: "/configuration/inline-assistant" }, |
67 | | - { text: "Prompt Library", link: "/configuration/prompt-library" }, |
68 | | - { text: "System Prompt", link: "/configuration/system-prompt" }, |
69 | | - { text: "Others", link: "/configuration/others" }, |
70 | | - ], |
71 | | - }, |
72 | | - { |
73 | | - text: "Usage", |
74 | | - collapsed: false, |
75 | | - items: [ |
76 | | - { text: "Introduction", link: "/usage/introduction" }, |
77 | | - { text: "Action Palette", link: "/usage/action-palette" }, |
78 | | - { |
79 | | - text: "Chat Buffer", |
80 | | - link: "/usage/chat-buffer/", |
81 | | - collapsed: true, |
82 | | - items: [ |
83 | | - { text: "Agents/Tools", link: "/usage/chat-buffer/agents" }, |
84 | | - { |
85 | | - text: "Slash Commands", |
86 | | - link: "/usage/chat-buffer/slash-commands", |
87 | | - }, |
88 | | - { text: "Variables", link: "/usage/chat-buffer/variables" }, |
89 | | - ], |
90 | | - }, |
91 | | - { text: "Events", link: "/usage/events" }, |
92 | | - { text: "Inline Assistant", link: "/usage/inline-assistant" }, |
93 | | - { text: "User Interface", link: "/usage/ui" }, |
94 | | - { text: "Workflows", link: "/usage/workflows" }, |
95 | | - ], |
| 61 | + sidebar: [ |
| 62 | + { text: "Introduction", link: "/" }, |
| 63 | + { text: "Installation", link: "/installation" }, |
| 64 | + { text: "Getting Started", link: "/getting-started" }, |
| 65 | + { |
| 66 | + text: "Configuration", |
| 67 | + collapsed: true, |
| 68 | + items: [ |
| 69 | + { text: "Introduction", link: "/configuration/introduction" }, |
| 70 | + { text: "Action Palette", link: "/configuration/action-palette" }, |
| 71 | + { text: "Adapters", link: "/configuration/adapters" }, |
| 72 | + { text: "Chat Buffer", link: "/configuration/chat-buffer" }, |
| 73 | + { |
| 74 | + text: "Inline Assistant", |
| 75 | + link: "/configuration/inline-assistant", |
| 76 | + }, |
| 77 | + { text: "Prompt Library", link: "/configuration/prompt-library" }, |
| 78 | + { text: "System Prompt", link: "/configuration/system-prompt" }, |
| 79 | + { text: "Others", link: "/configuration/others" }, |
| 80 | + ], |
| 81 | + }, |
| 82 | + { |
| 83 | + text: "Usage", |
| 84 | + collapsed: false, |
| 85 | + items: [ |
| 86 | + { text: "Introduction", link: "/usage/introduction" }, |
| 87 | + { text: "Action Palette", link: "/usage/action-palette" }, |
| 88 | + { |
| 89 | + text: "Chat Buffer", |
| 90 | + link: "/usage/chat-buffer/", |
| 91 | + collapsed: true, |
| 92 | + items: [ |
| 93 | + { text: "Agents/Tools", link: "/usage/chat-buffer/agents" }, |
| 94 | + { |
| 95 | + text: "Slash Commands", |
| 96 | + link: "/usage/chat-buffer/slash-commands", |
| 97 | + }, |
| 98 | + { text: "Variables", link: "/usage/chat-buffer/variables" }, |
| 99 | + ], |
| 100 | + }, |
| 101 | + { text: "Events", link: "/usage/events" }, |
| 102 | + { text: "Inline Assistant", link: "/usage/inline-assistant" }, |
| 103 | + { text: "User Interface", link: "/usage/ui" }, |
| 104 | + { text: "Workflows", link: "/usage/workflows" }, |
| 105 | + ], |
| 106 | + }, |
| 107 | + { |
| 108 | + text: "Extending the Plugin", |
| 109 | + collapsed: false, |
| 110 | + items: [ |
| 111 | + { text: "Creating Adapters", link: "/extending/adapters" }, |
| 112 | + { text: "Creating Prompts", link: "/extending/prompts" }, |
| 113 | + { text: "Creating Tools", link: "/extending/tools" }, |
| 114 | + { text: "Creating Workflows", link: "/extending/workflows" }, |
| 115 | + { text: "Creating Workspaces", link: "/extending/workspace" }, |
| 116 | + ], |
| 117 | + }, |
| 118 | + ], |
| 119 | + |
| 120 | + editLink: { |
| 121 | + pattern: |
| 122 | + "https://github.com/olimorris/codecompanion.nvim/edit/main/doc/:path", |
| 123 | + text: "Edit this page on GitHub", |
96 | 124 | }, |
97 | | - { |
98 | | - text: "Extending the Plugin", |
99 | | - collapsed: false, |
100 | | - items: [ |
101 | | - { text: "Creating Adapters", link: "/extending/adapters" }, |
102 | | - { text: "Creating Prompts", link: "/extending/prompts" }, |
103 | | - { text: "Creating Tools", link: "/extending/tools" }, |
104 | | - { text: "Creating Workflows", link: "/extending/workflows" }, |
105 | | - { text: "Creating Workspaces", link: "/extending/workspace" }, |
106 | | - ], |
| 125 | + |
| 126 | + footer: { |
| 127 | + message: "Released under the MIT License.", |
| 128 | + copyright: "Copyright © 2024-present Oli Morris", |
107 | 129 | }, |
108 | | - ], |
109 | 130 |
|
110 | | - editLink: { |
111 | | - pattern: |
112 | | - "https://github.com/olimorris/codecompanion.nvim/edit/main/doc/:path", |
113 | | - text: "Edit this page on GitHub", |
114 | | - }, |
| 131 | + socialLinks: [ |
| 132 | + { |
| 133 | + icon: "github", |
| 134 | + link: "https://github.com/olimorris/codecompanion.nvim", |
| 135 | + }, |
| 136 | + ], |
115 | 137 |
|
116 | | - footer: { |
117 | | - message: "Released under the MIT License.", |
118 | | - copyright: "Copyright © 2024-present Oli Morris", |
| 138 | + search: { provider: "local" }, |
119 | 139 | }, |
120 | | - |
121 | | - socialLinks: [ |
122 | | - { |
123 | | - icon: "github", |
124 | | - link: "https://github.com/olimorris/codecompanion.nvim", |
125 | | - }, |
126 | | - ], |
127 | | - |
128 | | - search: { provider: "local" }, |
129 | | - }, |
130 | | -}); |
| 140 | + }), |
| 141 | +); |
0 commit comments