diff options
Diffstat (limited to 'subprojects/docs/docusaurus.config.ts')
-rw-r--r-- | subprojects/docs/docusaurus.config.ts | 297 |
1 files changed, 297 insertions, 0 deletions
diff --git a/subprojects/docs/docusaurus.config.ts b/subprojects/docs/docusaurus.config.ts new file mode 100644 index 00000000..5245e415 --- /dev/null +++ b/subprojects/docs/docusaurus.config.ts | |||
@@ -0,0 +1,297 @@ | |||
1 | /* | ||
2 | * Copyright (c) Facebook, Inc. and its affiliates. | ||
3 | * Copyright (c) 2024 The Refinery Authors <https://refinery.tools/> | ||
4 | * | ||
5 | * SPDX-License-Identifier: MIT AND EPL-2.0 | ||
6 | */ | ||
7 | |||
8 | import type { MDXOptions } from '@docusaurus/mdx-loader'; | ||
9 | import type { Options as DocsOptions } from '@docusaurus/plugin-content-docs'; | ||
10 | import type { Options as PagesOptions } from '@docusaurus/plugin-content-pages'; | ||
11 | import type { Options as ClassicThemeOptions } from '@docusaurus/theme-classic'; | ||
12 | import type { UserThemeConfig } from '@docusaurus/theme-common'; | ||
13 | import type { UserThemeConfig as AlgoliaConfig } from '@docusaurus/theme-search-algolia'; | ||
14 | import type { Config } from '@docusaurus/types'; | ||
15 | import { Config as SwcConfig } from '@swc/core'; | ||
16 | import { themes } from 'prism-react-renderer'; | ||
17 | import smartypants from 'remark-smartypants'; | ||
18 | |||
19 | import remarkPosix2Windows from './src/plugins/remarkPosix2Windows'; | ||
20 | |||
21 | const markdownOptions: Partial<MDXOptions> = { | ||
22 | remarkPlugins: [[smartypants, { dashes: 'oldschool' }], remarkPosix2Windows], | ||
23 | }; | ||
24 | |||
25 | const docsOptions = { | ||
26 | ...markdownOptions, | ||
27 | sidebarPath: undefined, | ||
28 | editUrl: | ||
29 | 'https://github.com/graphs4value/refinery/edit/main/subprojects/docs', | ||
30 | } satisfies DocsOptions; | ||
31 | |||
32 | export default { | ||
33 | title: 'Refinery', | ||
34 | tagline: 'An efficient graph solver for generating well-formed models', | ||
35 | url: 'https://refinery.tools', | ||
36 | baseUrl: '/', | ||
37 | baseUrlIssueBanner: false, | ||
38 | trailingSlash: true, | ||
39 | staticDirectories: ['static', 'build/javadocs'], | ||
40 | plugins: [ | ||
41 | [ | ||
42 | '@docusaurus/plugin-content-docs', | ||
43 | { | ||
44 | id: 'learn', | ||
45 | path: 'src/learn', | ||
46 | routeBasePath: '/learn', | ||
47 | ...docsOptions, | ||
48 | } satisfies DocsOptions, | ||
49 | ], | ||
50 | [ | ||
51 | '@docusaurus/plugin-content-docs', | ||
52 | { | ||
53 | id: 'develop', | ||
54 | path: 'src/develop', | ||
55 | routeBasePath: '/develop', | ||
56 | ...docsOptions, | ||
57 | } satisfies DocsOptions, | ||
58 | ], | ||
59 | [ | ||
60 | '@docusaurus/plugin-content-pages', | ||
61 | markdownOptions satisfies PagesOptions, | ||
62 | ], | ||
63 | '@docusaurus/plugin-sitemap', | ||
64 | './src/plugins/loadersPlugin.ts', | ||
65 | './src/plugins/swcMinifyPlugin.ts', | ||
66 | ], | ||
67 | themes: [ | ||
68 | [ | ||
69 | '@docusaurus/theme-classic', | ||
70 | { | ||
71 | customCss: [require.resolve('./src/css/custom.css')], | ||
72 | } satisfies ClassicThemeOptions, | ||
73 | ], | ||
74 | '@docusaurus/theme-search-algolia', | ||
75 | ], | ||
76 | themeConfig: { | ||
77 | colorMode: { | ||
78 | respectPrefersColorScheme: true, | ||
79 | }, | ||
80 | prism: { | ||
81 | additionalLanguages: ['bash', 'java'], | ||
82 | theme: themes.oneLight, | ||
83 | darkTheme: themes.oneDark, | ||
84 | }, | ||
85 | navbar: { | ||
86 | title: 'Refinery', | ||
87 | logo: { | ||
88 | src: '/logo.svg', | ||
89 | srcDark: '/logo-dark.svg', | ||
90 | }, | ||
91 | hideOnScroll: true, | ||
92 | items: [ | ||
93 | { | ||
94 | label: 'Learn', | ||
95 | to: '/learn', | ||
96 | }, | ||
97 | { | ||
98 | label: 'Develop', | ||
99 | to: '/develop', | ||
100 | }, | ||
101 | { | ||
102 | label: 'GitHub', | ||
103 | position: 'right', | ||
104 | href: 'https://github.com/graphs4value/refinery', | ||
105 | }, | ||
106 | { | ||
107 | label: 'Try now', | ||
108 | position: 'right', | ||
109 | href: 'https://refinery.services/', | ||
110 | className: 'navbar__link--try-now', | ||
111 | }, | ||
112 | ], | ||
113 | }, | ||
114 | footer: { | ||
115 | links: [ | ||
116 | { | ||
117 | title: 'Learn', | ||
118 | items: [ | ||
119 | { | ||
120 | label: 'Introduction', | ||
121 | to: '/learn', | ||
122 | }, | ||
123 | { | ||
124 | label: 'Tutorials', | ||
125 | to: '/learn/tutorials', | ||
126 | }, | ||
127 | { | ||
128 | label: 'Langauge reference', | ||
129 | to: '/learn/language', | ||
130 | }, | ||
131 | { | ||
132 | label: 'Run in Docker', | ||
133 | to: '/learn/docker', | ||
134 | }, | ||
135 | ], | ||
136 | }, | ||
137 | { | ||
138 | title: 'Develop', | ||
139 | items: [ | ||
140 | { | ||
141 | label: 'Programming guide', | ||
142 | to: '/develop', | ||
143 | }, | ||
144 | { | ||
145 | label: 'Contributing', | ||
146 | to: '/develop/contributing', | ||
147 | }, | ||
148 | { | ||
149 | label: 'Javadoc', | ||
150 | to: '/develop/javadoc', | ||
151 | }, | ||
152 | ], | ||
153 | }, | ||
154 | { | ||
155 | title: 'More', | ||
156 | items: [ | ||
157 | { | ||
158 | label: 'Try now', | ||
159 | href: 'https://refinery.services/', | ||
160 | }, | ||
161 | { | ||
162 | label: 'GitHub', | ||
163 | href: 'https://github.com/graphs4value/refinery', | ||
164 | }, | ||
165 | { | ||
166 | label: 'License', | ||
167 | to: '/license', | ||
168 | }, | ||
169 | ], | ||
170 | }, | ||
171 | { | ||
172 | title: 'Supporters', | ||
173 | items: [ | ||
174 | { | ||
175 | label: 'BME MIT FTSRG', | ||
176 | href: 'https://ftsrg.mit.bme.hu/en/', | ||
177 | }, | ||
178 | { | ||
179 | label: 'McGill ECE', | ||
180 | href: 'https://www.mcgill.ca/', | ||
181 | }, | ||
182 | { | ||
183 | label: '2022 Amazon Research Awards', | ||
184 | href: 'https://www.amazon.science/research-awards/recipients/daniel-varro-fall-2021', | ||
185 | }, | ||
186 | { | ||
187 | label: 'LiU Software and Systems', | ||
188 | href: 'https://liu.se/en/organisation/liu/ida/sas', | ||
189 | }, | ||
190 | { | ||
191 | label: 'WASP', | ||
192 | href: 'https://wasp-sweden.org/', | ||
193 | }, | ||
194 | ], | ||
195 | }, | ||
196 | ], | ||
197 | copyright: ` | ||
198 | Copyright © 2021-2024 | ||
199 | <a href="https://github.com/graphs4value/refinery/blob/main/CONTRIBUTORS.md#the-refinery-authors" target="_blank">The Refinery Authors</a>. | ||
200 | Available under the | ||
201 | <a href="/license/">Eclipse Public License - v 2.0</a>. | ||
202 | `, | ||
203 | }, | ||
204 | algolia: { | ||
205 | appId: 'KYHOYEO80F', | ||
206 | apiKey: '152acfb8d1ad9e10f29f083a6b017a69', | ||
207 | indexName: 'refinery', | ||
208 | }, | ||
209 | } satisfies UserThemeConfig & AlgoliaConfig, | ||
210 | webpack: { | ||
211 | // Speed up builds by using a native Javascript loader. | ||
212 | // See: https://github.com/facebook/docusaurus/issues/4765#issuecomment-841135926 | ||
213 | // But we follow the Docusaurus upstream from | ||
214 | // https://github.com/facebook/docusaurus/blob/791da2e4a1a53aa6309887059e3f112fcb35bec4/website/docusaurus.config.ts#L152-L171 | ||
215 | // and use swc instead of esbuild. | ||
216 | jsLoader: (isServer) => ({ | ||
217 | loader: require.resolve('swc-loader'), | ||
218 | options: { | ||
219 | jsc: { | ||
220 | parser: { | ||
221 | syntax: 'typescript', | ||
222 | tsx: true, | ||
223 | }, | ||
224 | transform: { | ||
225 | react: { | ||
226 | runtime: 'automatic', | ||
227 | }, | ||
228 | }, | ||
229 | target: 'es2022', | ||
230 | }, | ||
231 | module: { | ||
232 | type: isServer ? 'commonjs' : 'es6', | ||
233 | }, | ||
234 | } satisfies SwcConfig, | ||
235 | }), | ||
236 | }, | ||
237 | headTags: [ | ||
238 | { | ||
239 | tagName: 'link', | ||
240 | attributes: { | ||
241 | rel: 'icon', | ||
242 | href: '/favicon.svg', | ||
243 | type: 'image/svg+xml', | ||
244 | }, | ||
245 | }, | ||
246 | { | ||
247 | tagName: 'link', | ||
248 | attributes: { | ||
249 | rel: 'icon', | ||
250 | href: '/favicon.png', | ||
251 | type: 'image/png', | ||
252 | sizes: '32x32', | ||
253 | }, | ||
254 | }, | ||
255 | { | ||
256 | tagName: 'link', | ||
257 | attributes: { | ||
258 | rel: 'icon', | ||
259 | href: '/favicon-96x96.png', | ||
260 | type: 'image/png', | ||
261 | sizes: '96x96', | ||
262 | }, | ||
263 | }, | ||
264 | { | ||
265 | tagName: 'link', | ||
266 | attributes: { | ||
267 | rel: 'apple-touch-icon', | ||
268 | href: '/apple-touch-icon.png', | ||
269 | type: 'image/png', | ||
270 | sizes: '180x180', | ||
271 | }, | ||
272 | }, | ||
273 | { | ||
274 | tagName: 'link', | ||
275 | attributes: { | ||
276 | rel: 'manifest', | ||
277 | href: '/manifest.webmanifest', | ||
278 | }, | ||
279 | }, | ||
280 | { | ||
281 | tagName: 'meta', | ||
282 | attributes: { | ||
283 | name: 'theme-color', | ||
284 | media: '(prefers-color-scheme:light)', | ||
285 | content: '#f5f5f5', | ||
286 | }, | ||
287 | }, | ||
288 | { | ||
289 | tagName: 'meta', | ||
290 | attributes: { | ||
291 | name: 'theme-color', | ||
292 | media: '(prefers-color-scheme:dark)', | ||
293 | content: '#282c34', | ||
294 | }, | ||
295 | }, | ||
296 | ], | ||
297 | } satisfies Config; | ||