-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
577 lines (554 loc) · 20.1 KB
/
docusaurus.config.js
File metadata and controls
577 lines (554 loc) · 20.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
const path = require("path");
const platformEnterpriseVersions = require("./platform-enterprise_versions.json");
import "dotenv/config";
import platform_enterprise_latest_version from "./platform-enterprise_latest_version.js";
import {
createSeqeraConfig,
getSeqeraThemeConfig,
getSeqeraPresetOptions
} from "@seqera/docusaurus-preset-seqera";
// Build the search filter_by dynamically so old platform-enterprise versions are
// excluded automatically whenever a new version is added to versions.json.
// versions.json is ordered newest-first; index 0 is the current/latest version.
const oldEnterpriseVersionTags = platformEnterpriseVersions
.slice(1)
.map((v) => `docs-platform-enterprise-${v}`);
const searchFilterBy = `docusaurus_tag:!=[default,doc_tag_doc_list,blog_posts_list,blog_tags_posts,doc_tags_list,blog_tags_list${oldEnterpriseVersionTags.length ? `,${oldEnterpriseVersionTags.join(",")}` : ""}]`;
export default async function createConfigAsync() {
const changelog = {
blogTitle: "Seqera Changelog",
blogDescription: "Blog",
blogSidebarCount: 5000,
blogSidebarTitle: "Changelog",
path: "changelog",
routeBasePath: "/changelog",
//processBlogPosts: () => ({}),
include: ["**/*.{md,mdx}"],
showReadingTime: false,
feedOptions: {
type: "all", // 'rss', 'atom', or both
title: "Seqera Changelog",
description: "Stay updated with our blog posts!",
copyright: `Copyright © ${new Date().getFullYear()} Seqera`,
},
onUntruncatedBlogPosts: "ignore",
};
const docs_platform_enterprise = [
"@docusaurus/plugin-content-docs",
{
id: "platform-enterprise",
routeBasePath: "/platform-enterprise",
path: "platform-enterprise_docs",
// For PR Previews we want to see the latest doc-set with expected changes.
includeCurrentVersion: process.env.INCLUDE_NEXT ? true : false,
lastVersion: platform_enterprise_latest_version,
remarkPlugins: [
(await import("remark-code-import")).default,
(await require("remark-math")).default,
(await import("docusaurus-remark-plugin-tab-blocks")).default,
(await require("remark-yaml-to-table")).default,
],
rehypePlugins: [require("rehype-katex")],
editUrl: "https://github.com/seqeralabs/docs/tree/master/",
sidebarPath: "platform-enterprise_docs/enterprise-sidebar.json",
},
];
const docs_platform_api = [
"@docusaurus/plugin-content-docs",
{
id: "platform-api",
routeBasePath: "/platform-api",
path: "platform-api-docs/docs",
remarkPlugins: [(await require("remark-yaml-to-table")).default],
sidebarPath: "platform-api-docs/docs/sidebar/sidebar.js",
docItemComponent: "@theme/ApiItem",
},
];
const docs_platform_cli = [
"@docusaurus/plugin-content-docs",
{
id: "platform-cli",
routeBasePath: "/platform-cli",
path: "platform-cli-docs/docs",
remarkPlugins: [
(await import("remark-code-import")).default,
(await require("remark-math")).default,
(await import("docusaurus-remark-plugin-tab-blocks")).default,
(await require("remark-yaml-to-table")).default,
],
rehypePlugins: [require("rehype-katex")],
sidebarPath: "platform-cli-docs/docs/sidebar/sidebar.js",
editUrl: "https://github.com/seqeralabs/docs/tree/master/",
},
];
const docs_platform_cloud = [
"@docusaurus/plugin-content-docs",
{
id: "platform-cloud",
routeBasePath: "/platform-cloud",
path: "platform-cloud/docs",
remarkPlugins: [
(await import("remark-code-import")).default,
(await require("remark-math")).default,
(await import("docusaurus-remark-plugin-tab-blocks")).default,
(await require("remark-yaml-to-table")).default,
],
rehypePlugins: [require("rehype-katex")],
editUrl: "https://github.com/seqeralabs/docs/tree/master/",
sidebarPath: "./platform-cloud/cloud-sidebar.json",
},
];
const docs_multiqc = [
"@docusaurus/plugin-content-docs",
{
id: "multiqc",
routeBasePath: "/multiqc",
path: "multiqc_docs/multiqc_repo/docs/markdown",
remarkPlugins: [
(await import("remark-code-import")).default,
(await require("remark-math")).default,
(await import("docusaurus-remark-plugin-tab-blocks")).default,
(await require("remark-yaml-to-table")).default,
],
rehypePlugins: [require("rehype-katex")],
editUrl: ({ docPath }) => {
return `https://github.com/MultiQC/MultiQC/blob/main/docs/markdown/${docPath.replace("multiqc_docs/multiqc_repo/docs", "")}`;
},
sidebarPath: "./multiqc_docs/sidebar.js",
},
];
const docs_fusion = [
"@docusaurus/plugin-content-docs",
{
id: "fusion",
routeBasePath: "/fusion",
path: "fusion_docs",
remarkPlugins: [
(await import("remark-code-import")).default,
(await require("remark-math")).default,
(await import("docusaurus-remark-plugin-tab-blocks")).default,
(await require("remark-yaml-to-table")).default,
],
rehypePlugins: [require("rehype-katex")],
editUrl: "https://github.com/seqeralabs/docs/tree/master/",
sidebarPath: "./fusion_docs/sidebar.json",
},
];
const docs_wave = [
"@docusaurus/plugin-content-docs",
{
id: "wave",
routeBasePath: "/wave",
path: "wave_docs/wave_repo/docs",
remarkPlugins: [
(await import("remark-code-import")).default,
(await require("remark-math")).default,
(await import("docusaurus-remark-plugin-tab-blocks")).default,
(await require("remark-yaml-to-table")).default,
(await import("remark-deflist")).default,
],
rehypePlugins: [require("rehype-katex")],
editUrl: ({ docPath }) => {
return `https://github.com/seqeralabs/wave/blob/master/docs/${docPath.replace("wave_docs/wave_repo/docs", "")}`;
},
sidebarPath: "./wave_docs/sidebar.json",
},
];
console.log(
"\n EXCLUDE_CHANGELOG: " + (process.env.EXCLUDE_CHANGELOG ? true : false),
"\n EXCLUDE_PLATFORM_ENTERPRISE: " +
(process.env.EXCLUDE_PLATFORM_ENTERPRISE ? true : false),
"\n EXCLUDE_PLATFORM_CLOUD: " +
(process.env.EXCLUDE_PLATFORM_CLOUD ? true : false),
"\n EXCLUDE_PLATFORM_API: " +
(process.env.EXCLUDE_PLATFORM_API ? true : false),
"\n EXCLUDE_PLATFORM_CLI: " +
(process.env.EXCLUDE_PLATFORM_CLI ? true : false),
"\n EXCLUDE_PLATFORM_OPENAPI: " +
(process.env.EXCLUDE_PLATFORM_OPENAPI ? true : false),
"\n EXCLUDE_MULTIQC: " + (process.env.EXCLUDE_MULTIQC ? true : false),
"\n EXCLUDE_FUSION: " + (process.env.EXCLUDE_FUSION ? true : false),
"\n EXCLUDE_WAVE: " + (process.env.EXCLUDE_WAVE ? true : false),
"\n INCLUDE_NEXT: " + (process.env.INCLUDE_NEXT ? true : false),
);
return createSeqeraConfig({
title: "Seqera Docs",
tagline: "Documentation for Seqera products",
url: "https://docs.seqera.io",
/*
* Enable faster Docusaurus optimizations (experimental v4 features)
* Reference: https://github.com/facebook/docusaurus/issues/10556
*
* WARNING: swcJsMinimizer & lightningCssMinimizer are disabled due to memory issues
* - Cause excessive memory usage leading to build failures
* - The believe is that our 22k of OpenAPI docs causes this issue due to the way they are generated.
* - See: https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/1025
*
* These optimizations may require additional configuration when memory issues are resolved.
*/
future: {
experimental_faster: {
swcJsLoader: false,
swcJsMinimizer: false,
swcHtmlMinimizer: false,
lightningCssMinimizer: false,
rspackBundler: true,
rspackPersistentCache: false,
mdxCrossCompilerCache: false,
},
},
// If you aren't using GitHub pages, you don't need these.
organizationName: "seqeralabs", // Usually your GitHub org/user name.
projectName: "docs", // Usually your repo name.
onBrokenLinks:
process.env.FAIL_ON_BROKEN_LINKS === "true" ? "throw" : "warn",
onBrokenAnchors:
process.env.FAIL_ON_BROKEN_LINKS === "true" ? "throw" : "warn",
// TODO: markdown.hooks not supported in Docusaurus 3.8.1 - upgrade Docusaurus or remove
// markdown: {
// hooks: {
// onBrokenMarkdownLinks:
// process.env.FAIL_ON_BROKEN_LINKS === "true" ? "throw" : "warn",
// },
// },
markdown: {
// The vendored MultiQC `config_schema.md` is auto-generated from a Python
// schema and contains literal `{...}` examples and `<details>` blocks
// around fenced code that the MDX parser rejects. Force CommonMark for
// that file so its content renders as plain markdown + HTML.
parseFrontMatter: async ({ filePath, fileContent, defaultParseFrontMatter }) => {
const result = await defaultParseFrontMatter({ filePath, fileContent });
if (filePath.endsWith("multiqc_docs/multiqc_repo/docs/markdown/config_schema.md")) {
result.frontMatter.mdx = { ...(result.frontMatter.mdx || {}), format: "md" };
}
return result;
},
},
customFields: {
// Put your custom environment here
},
clientModules: [
require.resolve('./src/client-modules/cross-site-nav.js'),
require.resolve('./src/client-modules/posthog-search.js'),
require.resolve('./src/client-modules/katex-css.js'),
],
presets: [
[
"@seqera/docusaurus-preset-seqera",
await getSeqeraPresetOptions({
blog: process.env.EXCLUDE_CHANGELOG ? false : changelog,
docs: false,
theme: {
customCss: require.resolve("./src/custom.css"),
},
openapi: process.env.EXCLUDE_PLATFORM_OPENAPI
? false
: {
id: "api",
docsPluginId: "platform-api",
config: {
platform: {
specPath: "platform-api-docs/scripts/specs/seqera-api-latest-decorated.yml",
outputDir: "platform-api-docs/docs",
sidebarOptions: {
groupPathsBy: "tag",
},
},
},
},
gtag: {
trackingID: "G-NR1CNM213G",
anonymizeIP: true,
},
googleTagManager: {
containerId: "GTM-MBCJKK4",
},
}),
],
],
plugins: [
process.env.EXCLUDE_PLATFORM_ENTERPRISE ? null : docs_platform_enterprise,
process.env.EXCLUDE_PLATFORM_CLOUD ? null : docs_platform_cloud,
process.env.EXCLUDE_PLATFORM_API ? null : docs_platform_api,
process.env.EXCLUDE_PLATFORM_CLI ? null : docs_platform_cli,
process.env.EXCLUDE_MULTIQC ? null : docs_multiqc,
process.env.EXCLUDE_FUSION ? null : docs_fusion,
process.env.EXCLUDE_WAVE ? null : docs_wave,
['docusaurus-plugin-llms', {
id: 'llms-enterprise',
docsDir: 'platform-enterprise_docs',
llmsTxtFilename: 'llms-enterprise.txt',
llmsFullTxtFilename: 'llms-enterprise-full.txt',
title: 'Seqera Platform Enterprise',
description: 'Documentation for Seqera Platform Enterprise.',
rootContent: 'This file contains links to Seqera Platform Enterprise documentation following the llmstxt.org standard.',
generateLLMsTxt: true,
generateLLMsFullTxt: true,
generateMarkdownFiles: true,
includeBlog: false,
excludeImports: true,
removeDuplicateHeadings: true,
ignoreFiles: ['**/tags', '**/tags/**'],
processingBatchSize: 50,
}],
['docusaurus-plugin-llms', {
id: 'llms-cloud',
docsDir: 'platform-cloud/docs',
llmsTxtFilename: 'llms-cloud.txt',
llmsFullTxtFilename: 'llms-cloud-full.txt',
title: 'Seqera Platform Cloud',
description: 'Documentation for Seqera Platform Cloud.',
rootContent: 'This file contains links to Seqera Platform Cloud documentation following the llmstxt.org standard.',
generateLLMsTxt: true,
generateLLMsFullTxt: true,
generateMarkdownFiles: true,
includeBlog: false,
excludeImports: true,
removeDuplicateHeadings: true,
ignoreFiles: ['**/tags', '**/tags/**'],
processingBatchSize: 50,
}],
['docusaurus-plugin-llms', {
id: 'llms-api',
docsDir: 'platform-api-docs/docs',
llmsTxtFilename: 'llms-api.txt',
llmsFullTxtFilename: 'llms-api-full.txt',
title: 'Seqera Platform API',
description: 'API reference documentation for the Seqera Platform REST API.',
rootContent: 'This file contains links to Seqera Platform API reference documentation following the llmstxt.org standard.',
generateLLMsTxt: true,
generateLLMsFullTxt: true,
generateMarkdownFiles: true,
includeBlog: false,
excludeImports: true,
removeDuplicateHeadings: true,
ignoreFiles: ['**/tags', '**/tags/**'],
processingBatchSize: 50,
}],
['docusaurus-plugin-llms', {
id: 'llms-cli',
docsDir: 'platform-cli-docs/docs',
llmsTxtFilename: 'llms-cli.txt',
llmsFullTxtFilename: 'llms-cli-full.txt',
title: 'Seqera Platform CLI',
description: 'Documentation for the Seqera Platform command-line interface.',
rootContent: 'This file contains links to Seqera Platform CLI documentation following the llmstxt.org standard.',
generateLLMsTxt: true,
generateLLMsFullTxt: true,
generateMarkdownFiles: true,
includeBlog: false,
excludeImports: true,
removeDuplicateHeadings: true,
ignoreFiles: ['**/tags', '**/tags/**'],
processingBatchSize: 50,
}],
['docusaurus-plugin-llms', {
id: 'llms-multiqc',
docsDir: 'multiqc_docs/multiqc_repo/docs/markdown',
llmsTxtFilename: 'llms-multiqc.txt',
llmsFullTxtFilename: 'llms-multiqc-full.txt',
title: 'MultiQC',
description: 'Documentation for MultiQC',
rootContent: 'This file contains links to MultiQC documentation following the llmstxt.org standard.',
generateLLMsTxt: true,
generateLLMsFullTxt: true,
generateMarkdownFiles: true,
includeBlog: false,
excludeImports: true,
removeDuplicateHeadings: true,
ignoreFiles: ['**/tags', '**/tags/**'],
processingBatchSize: 50,
}],
['docusaurus-plugin-llms', {
id: 'llms-fusion',
docsDir: 'fusion_docs',
llmsTxtFilename: 'llms-fusion.txt',
llmsFullTxtFilename: 'llms-fusion-full.txt',
title: 'Fusion',
description: 'Documentation for Fusion.',
rootContent: 'This file contains links to Fusion documentation following the llmstxt.org standard.',
generateLLMsTxt: true,
generateLLMsFullTxt: true,
generateMarkdownFiles: true,
includeBlog: false,
excludeImports: true,
removeDuplicateHeadings: true,
ignoreFiles: ['**/tags', '**/tags/**'],
processingBatchSize: 50,
}],
['docusaurus-plugin-llms', {
id: 'llms-wave',
docsDir: 'wave_docs/wave_repo/docs',
llmsTxtFilename: 'llms-wave.txt',
llmsFullTxtFilename: 'llms-wave-full.txt',
title: 'Wave',
description: 'Documentation for Wave.',
rootContent: 'This file contains links to Wave documentation following the llmstxt.org standard.',
generateLLMsTxt: true,
generateLLMsFullTxt: true,
generateMarkdownFiles: true,
includeBlog: false,
excludeImports: true,
removeDuplicateHeadings: true,
ignoreFiles: ['**/tags', '**/tags/**'],
processingBatchSize: 50,
}],
// Disable expensive bundler options: https://github.com/facebook/docusaurus/pull/11176
function disableExpensiveBundlerOptimizationPlugin() {
return {
name: 'disable-expensive-bundler-optimizations',
configureWebpack(_config) {
return {
optimization: {
concatenateModules: false,
},
resolve: {
fallback: {
path: require.resolve('path-browserify'),
},
},
};
},
};
},
].filter(Boolean),
themeConfig: getSeqeraThemeConfig({
seqera: {
docs: {
versionDropdown: {
'platform-enterprise': {
showCurrent: process.env.INCLUDE_NEXT ? true : false,
},
},
},
},
typesense: {
typesenseCollectionName: 'seqera_docs',
searchPagePath: '/search',
typesenseServerConfig: {
nodes: [
{
host: 'uk4gflrza0d8yx5sp-1.a1.typesense.net',
port: 443,
protocol: 'https',
},
],
apiKey: 'KZsuSjc7jPqDm7pkl1kN8TkoHH9b3dwY',
connectionTimeoutSeconds: 2,
},
typesenseSearchParameters: {
query_by: 'content,hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3',
query_by_weights: '1,1,4,3,2',
drop_tokens_threshold: 0,
group_by: 'url',
group_limit: 1,
per_page: 20,
num_typos: 2,
prioritize_exact_match: true,
filter_by: searchFilterBy, // Old platform-enterprise versions excluded automatically via searchFilterBy above
},
contextualSearch: false,
placeholder: 'Search Seqera docs...',
// Override default productRoutes to fix the Nextflow tag.
// The default uses 'docs-default-current' but the Typesense index
// has 'docs-nextflow-current'.
productRoutes: [
['/platform-enterprise/', 'Platform Enterprise', 'platform-enterprise', null],
['/platform-cloud/', 'Platform Cloud', 'platform-cloud', null],
['/platform-cli/', 'Platform CLI', 'platform-cli', null],
['/platform-api/', 'Platform API', 'platform-api', null],
['/nextflow/', 'Nextflow', null, 'docs-nextflow-current'],
['/multiqc/', 'MultiQC', 'multiqc', null],
['/wave/', 'Wave', 'wave', null],
['/fusion/', 'Fusion', 'fusion', null],
['/changelog/', 'Changelog', null, null],
],
},
languageTabs: [
{
highlight: "python",
language: "python",
logoClass: "python",
},
{
highlight: "bash",
language: "curl",
logoClass: "curl",
},
{
highlight: "java",
language: "java",
logoClass: "java",
variant: "unirest",
},
{
highlight: "r",
language: "r",
logoClass: "r",
},
{
highlight: "javascript",
language: "javascript",
logoClass: "javascript",
},
{
highlight: "go",
language: "go",
logoClass: "go",
},
{
highlight: "powershell",
language: "powershell",
logoClass: "powershell",
},
],
prism: {
additionalLanguages: [
"bash",
"docker",
"groovy",
"ini",
"java",
"javascript",
"json",
"nextflow",
"nginx",
"python",
"r",
"shell-session",
"sql",
"typescript",
"yaml",
],
},
navbar: {
items: [
{
label: 'Cloud',
href: '/platform-cloud/',
},
{
label: 'Enterprise',
href: '/platform-enterprise/',
},
{
label: 'Nextflow',
href: '/nextflow/',
},
{
label: 'MultiQC',
href: '/multiqc/',
},
{
label: 'Wave',
href: '/wave/',
},
{
label: 'Fusion',
href: '/fusion/',
},
],
},
}),
});
}