-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurus.config.js
393 lines (382 loc) · 12.2 KB
/
docusaurus.config.js
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
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const {themes} = require('prism-react-renderer');
const { directiveDescriptor } = require("@graphql-markdown/helpers");
const lightTheme = themes.github;
const darkTheme = themes.dracula;
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "AKASHA docs",
tagline: "Build your own application with AKASHA",
url: "https://akasha-docs.pages.dev",
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon.ico",
organizationName: "AKASHAorg", // Usually your GitHub org/user name.
projectName: "akasha-docs", // Usually your repo name.
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
// required to set the doc with / slug as landing page
routeBasePath: "/",
showLastUpdateTime: true,
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
}),
],
],
plugins: [
[
"docusaurus-plugin-typedoc",
{
id: "akasha-sdk-main",
entryPoints: ["./akasha-core/libs/sdk/src/index.ts"],
entryPointStrategy: "expand",
tsconfig: "./akasha-core/libs/sdk/tsconfig.json",
readme: "none",
out: "./docs/sdk/api-reference",
name: "AKASHA SDK reference",
categorizeByGroup: false,
excludeInternal: true,
categoryOrder: ["API", "Services"],
stripYamlFrontmatter: true,
hidePageTitle: true,
hidePageHeader: true,
fileExtension: ".mdx",
flattenOutputFiles: true,
sidebarLinks: {},
enumMembersFormat: 'table',
typeDeclarationFormat: "table",
parametersFormat: "table",
propertiesFormat: "table",
indexFormat: "table",
membersWithOwnFile: [],
navigationModel: {
excludeFolders: true,
},
plugin: ["typedoc-plugin-merge-modules"],
mergeModulesRenameDefaults: true,
mergeModulesMergeMode: "module",
sidebar: {
categoryLabel: "SDK reference",
position: 5,
}
},
],
[
"docusaurus-plugin-typedoc",
{
id: "akasha-ui-hooks",
entryPoints: [
"./akasha-core/libs/hooks/src/generated/index.ts",
"./akasha-core/libs/hooks/src/index.ts"
],
entryPointStrategy: "expand",
tsconfig: "./akasha-core/libs/hooks/tsconfig.json",
readme: "none",
entryFileName: "readme.md",
out: "./docs/react-hooks/hooks",
name: "Hooks List",
stripYamlFrontmatter: true,
fileExtension: '.md',
flattenOutputFiles: true,
enumMembersFormat: 'table',
typeDeclarationFormat: "table",
parametersFormat: "table",
propertiesFormat: "table",
indexFormat: "table",
membersWithOwnFile: [],
groupOrder: ["Functions", "*"],
navigationModel: {
excludeFolders: true,
excludeGroups: true,
},
plugin: ["typedoc-plugin-merge-modules"],
mergeModulesRenameDefaults: true,
mergeModulesMergeMode: "project",
textContentMappings: {
"kind.function.plural": "Hooks",
"kind.function.singular": "Hook",
}
},
],
[
"docusaurus-plugin-typedoc",
{
id: "ui-events-bus",
entryPoints: ["./akasha-core/libs/typings/src/ui/ui-events.ts"],
entryPointStrategy: "expand",
tsconfig: "./akasha-core/libs/typings/tsconfig.json",
out: "./docs/event-bus/ui-events",
name: "UI Events",
stripYamlFrontmatter: true,
hidePageHeader: true,
hidePageTitle: true,
flattenOutputFiles: true,
// the output result is the same because readme.md is the same as index.md
// but in this case it's clearer where we are linking
entryFileName: 'readme.md',
readme: './docs/event-bus/_ui_event_bus.md',
mergeReadme: true,
enumMembersFormat: 'table',
typeDeclarationFormat: "table",
parametersFormat: "table",
propertiesFormat: "table",
membersWithOwnFile: [],
groupOrder: ["Type Aliases", "*"],
navigationModel: {
excludeFolders: true,
},
plugin: ["typedoc-plugin-merge-modules"],
mergeModulesRenameDefaults: true,
mergeModulesMergeMode: "project",
}
],
[
"docusaurus-plugin-typedoc",
{
id: "global-events-bus",
entryPoints: ["./akasha-core/libs/sdk/src/common/event-bus.ts"],
entryPointStrategy: "expand",
tsconfig: "./akasha-core/libs/sdk/tsconfig.json",
out: "./docs/event-bus/global-events",
name: "Global Events",
stripYamlFrontmatter: true,
hidePageHeader: true,
hidePageTitle: true,
flattenOutputFiles: true,
// the output result is the same because readme.md is the same as index.md
// but in this case it's clearer where we are linking
entryFileName: 'readme.md',
readme: './docs/event-bus/_global_event_bus.md',
mergeReadme: true,
enumMembersFormat: 'table',
typeDeclarationFormat: "table",
parametersFormat: "table",
propertiesFormat: "table",
membersWithOwnFile: [],
groupOrder: ["Type Aliases", "*"],
navigationModel: {
excludeFolders: true,
},
plugin: ["typedoc-plugin-merge-modules"],
mergeModulesRenameDefaults: true,
mergeModulesMergeMode: "project",
}
],
[
"docusaurus-plugin-typedoc",
{
id: "design-system-core",
entryPoints: ["./akasha-core/libs/design-system-core/src/components/*"],
entryPointStrategy: "expand",
exclude: ["**/*+(.test|.spec).tsx"],
tsconfig: "./akasha-core/libs/design-system-core/tsconfig.json",
out: "./docs/design-system/design-system-core",
name: "Design System Core",
stripYamlFrontmatter: true,
hidePageTitle: true,
hidePageHeader: true,
flattenOutputFiles: true,
sidebarLinks: {},
enumMembersFormat: 'table',
typeDeclarationFormat: "table",
parametersFormat: "table",
propertiesFormat: "table",
indexFormat: "table",
membersWithOwnFile: [],
groupOrder: ["Classes", "Functions", "Type Aliases", "*"],
// entryFileName is required because there is a link
// in the design-system-components to the readme file
entryFileName: "README.md",
navigationModel: {
excludeFolders: true,
},
plugin: ["typedoc-plugin-merge-modules"],
mergeModulesRenameDefaults: true,
mergeModulesMergeMode: "module",
textContentMappings: {
"kind.function.plural": "Components",
"kind.class.singular": "Class Component",
"kind.class.plural": "Class Components",
"kind.typeAlias.singular": "Prop",
"kind.typeAlias.plural": "Props",
}
}
],
[
"docusaurus-plugin-typedoc",
{
id: "design-system-components",
entryPoints: ["./akasha-core/libs/design-system-components/src/components/*"],
entryPointStrategy: "expand",
exclude: ["**/*+(.test|.spec).tsx"],
tsconfig: "./akasha-core/libs/design-system-components/tsconfig.json",
out: "./docs/design-system/design-system-components",
name: "Design System Components",
stripYamlFrontmatter: true,
hidePageTitle: true,
hidePageHeader: true,
flattenOutputFiles: true,
sidebarLinks: {},
enumMembersFormat: 'table',
typeDeclarationFormat: "table",
parametersFormat: "table",
propertiesFormat: "table",
indexFormat: "table",
membersWithOwnFile: [],
groupOrder: ["Classes", "Functions", "Type Aliases", "*"],
navigationModel: {
excludeFolders: true,
},
plugin: ["typedoc-plugin-merge-modules"],
mergeModulesRenameDefaults: true,
mergeModulesMergeMode: "module",
textContentMappings: {
"kind.function.plural": "Components",
"kind.class.singular": "Class Component",
"kind.class.plural": "Class Components",
"kind.typeAlias.singular": "Prop",
"kind.typeAlias.plural": "Props",
}
}
],
[
"@graphql-markdown/docusaurus",
/** @type {import('@graphql-markdown/types').ConfigOptions} */
{
id: "composedb-models",
schema: "./akasha-core/libs/composedb/lib/schema.graphql",
rootPath: "./docs",
baseURL: "composedb-models",
// homepage: "./docs/composedb-models/index.md",
runOnBuild: true,
loaders: {
GraphQLFileLoader: "@graphql-tools/graphql-file-loader"
},
groupByDirective: true,
enumMembersFormat: 'table',
typeDeclarationFormat: "table",
parametersFormat: "table",
propertiesFormat: "table",
indexFormat: "table",
membersWithOwnFile: [],
navigationModel: {
excludeFolders: true,
},
printTypeOptions: {
useApiGroup: true,
deprecated: 'skip'
}
}
]
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
colorMode: {
defaultMode: "dark",
},
navbar: {
title: "AKASHA Docs",
items: [
{
href: "https://github.com/AKASHAorg/akasha-docs",
label: "View on GitHub",
position: "right",
},
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Introduction",
to: "/",
},
{
label: "Quick start",
to: "/dev-quickstart",
},
{
label: "Glossary",
to: "/glossary"
},
{
label: "Extensions",
to: "/extensions",
}
],
},
{
title: "Community",
items: [
{
label: "Discord",
href: "https://discord.com/invite/JqqKasJ",
},
{
label: "Telegram",
href: "https://t.me/worldofethereum",
},
{
label: "Twitter",
href: "https://twitter.com/AKASHAorg",
},
],
},
{
title: "More",
items: [
{
label: "GitHub",
href: "https://github.com/AKASHAorg",
},
{
label: "Docs GitHub",
href: "https://github.com/AKASHAorg/akasha-docs",
},
{
label: "Blog",
href: "https://blog.akasha.org",
},
],
},
],
copyright: `Copyright ©${new Date().getFullYear()} AKASHA Foundation`,
},
prism: {
theme: lightTheme,
darkTheme: darkTheme,
additionalLanguages: ['bash', 'diff', 'graphql', 'yaml', 'json', 'json5'],
},
}),
};
if (process.env['NODE_ENV'] === 'production' && !!config.themeConfig) {
config.themeConfig.algolia = {
// The application ID provided by Algolia
appId: process.env.ALGOLIA_APP_ID,
// Public API key
apiKey: process.env.ALGOLIA_API_KEY,
indexName: process.env.ALGOLIA_INDEX_NAME,
// Optional: see doc section below
contextualSearch: true,
// Optional: Specify domains where the navigation should occur through window.location instead on history.push.
// externalUrlRegex: 'external\\.com|domain\\.com',
// Optional: Algolia search parameters
searchParameters: {},
// Optional: path for search page that enabled by default (`false` to disable it)
searchPagePath: 'search',
//... other Algolia params
}
}
module.exports = config;