|
1 | 1 | // @ts-check |
2 | 2 | // Note: type annotations allow type checking and IDEs autocompletion |
3 | 3 |
|
4 | | -const lightCodeTheme = require('prism-react-renderer/themes/github'); |
5 | | -const darkCodeTheme = require('prism-react-renderer/themes/dracula'); |
6 | | -const simplePlantUML = require('@akebifiky/remark-simple-plantuml'); |
7 | | -const math = require('remark-math'); |
8 | | -const katex = require('rehype-katex'); |
| 4 | +import { themes } from 'prism-react-renderer'; |
| 5 | +import simplePlantUML from '@akebifiky/remark-simple-plantuml' |
| 6 | +import math from 'remark-math'; |
| 7 | +import katex from 'rehype-katex'; |
9 | 8 |
|
10 | | -async function createConfig() { |
11 | | - const mdxMermaid = await import('mdx-mermaid') |
12 | | - return { |
13 | | - title: 'Tagreader', |
14 | | - tagline: 'Tagreader.', |
15 | | - url: 'https://awt.app.radix.equinor.com/', |
16 | | - baseUrl: '/tagreader-python/', |
17 | | - onBrokenLinks: 'throw', |
18 | | - onBrokenMarkdownLinks: 'warn', |
19 | | - favicon: 'img/favicon.png', |
| 9 | +export default { |
| 10 | + title: 'Tagreader', |
| 11 | + tagline: 'Tagreader.', |
| 12 | + url: 'https://awt.app.radix.equinor.com/', |
| 13 | + baseUrl: '/tagreader-python/', |
| 14 | + onBrokenLinks: 'throw', |
| 15 | + onBrokenMarkdownLinks: 'warn', |
| 16 | + favicon: 'img/favicon.png', |
| 17 | + markdown: { |
| 18 | + mermaid: true |
| 19 | + }, |
| 20 | + themes: [ |
| 21 | + '@docusaurus/theme-mermaid' |
| 22 | + ], |
20 | 23 |
|
21 | | - // GitHub pages deployment config. |
22 | | - // If you aren't using GitHub pages, you don't need these. |
23 | | - organizationName: 'equinor', // Usually your GitHub org/username. |
24 | | - projectName: 'tagreader', // Usually your repo name. |
25 | | - deploymentBranch: 'gh-pages', |
| 24 | + // GitHub pages deployment config. |
| 25 | + // If you aren't using GitHub pages, you don't need these. |
| 26 | + organizationName: 'equinor', // Usually your GitHub org/username. |
| 27 | + projectName: 'tagreader', // Usually your repo name. |
| 28 | + deploymentBranch: 'gh-pages', |
26 | 29 |
|
27 | | - // Even if you don't use internalization, you can use this field to set useful |
28 | | - // metadata like html lang. For example, if your site is Chinese, you may want |
29 | | - // to replace "en" with "zh-Hans". |
30 | | - i18n: { |
31 | | - defaultLocale: 'en', |
32 | | - locales: ['en'], |
33 | | - }, |
| 30 | + // Even if you don't use internalization, you can use this field to set useful |
| 31 | + // metadata like html lang. For example, if your site is Chinese, you may want |
| 32 | + // to replace "en" with "zh-Hans". |
| 33 | + i18n: { |
| 34 | + defaultLocale: 'en', |
| 35 | + locales: ['en'], |
| 36 | + }, |
| 37 | + |
| 38 | + plugins: [ |
34 | 39 |
|
35 | | - plugins: [ |
| 40 | + ], |
36 | 41 |
|
| 42 | + presets: [ |
| 43 | + [ |
| 44 | + 'classic', |
| 45 | + /** @type {import('@docusaurus/preset-classic').Options} */ |
| 46 | + ({ |
| 47 | + docs: { |
| 48 | + sidebarPath: require.resolve('./sidebars.js'), |
| 49 | + editUrl: |
| 50 | + 'https://github.com/equinor/tagreader-python/tree/main/documentation/', |
| 51 | + remarkPlugins: [simplePlantUML, math], |
| 52 | + rehypePlugins: [katex], |
| 53 | + }, |
| 54 | + blog: false, |
| 55 | + theme: { |
| 56 | + customCss: require.resolve('./src/css/custom.css'), |
| 57 | + }, |
| 58 | + }), |
37 | 59 | ], |
| 60 | + ], |
38 | 61 |
|
39 | | - presets: [ |
40 | | - [ |
41 | | - 'classic', |
42 | | - /** @type {import('@docusaurus/preset-classic').Options} */ |
43 | | - ({ |
44 | | - docs: { |
45 | | - sidebarPath: require.resolve('./sidebars.js'), |
46 | | - editUrl: |
47 | | - 'https://github.com/equinor/tagreader-python/tree/main/documentation/', |
48 | | - remarkPlugins: [mdxMermaid.default, simplePlantUML, math], |
49 | | - rehypePlugins: [katex], |
| 62 | + themeConfig: |
| 63 | + /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ |
| 64 | + ({ |
| 65 | + navbar: { |
| 66 | + title: 'Tagreader', |
| 67 | + logo: { |
| 68 | + alt: 'Equinor Logo', |
| 69 | + src: 'img/logo.svg', |
| 70 | + }, |
| 71 | + items: [ |
| 72 | + { |
| 73 | + type: 'docSidebar', |
| 74 | + sidebarId: 'about', |
| 75 | + position: 'left', |
| 76 | + label: 'Docs', |
50 | 77 | }, |
51 | | - blog: false, |
52 | | - theme: { |
53 | | - customCss: require.resolve('./src/css/custom.css'), |
| 78 | + { |
| 79 | + type: 'docSidebar', |
| 80 | + sidebarId: 'contribute', |
| 81 | + position: 'left', |
| 82 | + label: 'Contribute', |
54 | 83 | }, |
55 | | - }), |
56 | | - ], |
57 | | - ], |
58 | | - |
59 | | - themeConfig: |
60 | | - /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ |
61 | | - ({ |
62 | | - navbar: { |
63 | | - title: 'Tagreader', |
64 | | - logo: { |
65 | | - alt: 'Equinor Logo', |
66 | | - src: 'img/logo.svg', |
| 84 | + { |
| 85 | + href: 'https://github.com/equinor/tagreader-python', |
| 86 | + label: 'GitHub', |
| 87 | + position: 'right', |
67 | 88 | }, |
68 | | - items: [ |
69 | | - { |
70 | | - type: 'docSidebar', |
71 | | - sidebarId: 'about', |
72 | | - position: 'left', |
73 | | - label: 'Docs', |
74 | | - }, |
75 | | - { |
76 | | - type: 'docSidebar', |
77 | | - sidebarId: 'contribute', |
78 | | - position: 'left', |
79 | | - label: 'Contribute', |
80 | | - }, |
81 | | - { |
82 | | - href: 'https://github.com/equinor/tagreader-python', |
83 | | - label: 'GitHub', |
84 | | - position: 'right', |
85 | | - }, |
86 | | - ], |
87 | | - }, |
88 | | - footer: { |
89 | | - style: 'dark', |
90 | | - links: [ |
91 | | - { |
92 | | - title: 'Docs', |
93 | | - items: [ |
94 | | - { |
95 | | - label: 'Docs', |
96 | | - to: '/docs/about/introduction', |
97 | | - }, |
98 | | - { |
99 | | - label: 'Contribute', |
100 | | - to: '/docs/contribute/how-to-start-contributing', |
101 | | - }, |
102 | | - ], |
103 | | - }, |
104 | | - { |
105 | | - title: 'More', |
106 | | - items: [ |
107 | | - { |
108 | | - label: 'GitHub', |
109 | | - href: 'https://github.com/equinor/tagreader', |
110 | | - }, |
| 89 | + ], |
| 90 | + }, |
| 91 | + footer: { |
| 92 | + style: 'dark', |
| 93 | + links: [ |
| 94 | + { |
| 95 | + title: 'Docs', |
| 96 | + items: [ |
| 97 | + { |
| 98 | + label: 'Docs', |
| 99 | + to: '/docs/about/introduction', |
| 100 | + }, |
111 | 101 | { |
112 | | - label: 'PyPi', |
113 | | - href: 'https://pypi.org/project/tagreader/', |
114 | | - }, |
115 | | - ], |
116 | | - }, |
117 | | - ], |
118 | | - copyright: `Built with Docusaurus.`, |
119 | | - }, |
120 | | - prism: { |
121 | | - theme: lightCodeTheme, |
122 | | - darkTheme: darkCodeTheme, |
123 | | - }, |
124 | | - colorMode: { |
125 | | - defaultMode: 'dark', |
126 | | - disableSwitch: false, |
127 | | - respectPrefersColorScheme: true, |
128 | | - } |
129 | | - }), |
130 | | - stylesheets: [ |
131 | | - { |
132 | | - href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css', |
133 | | - type: 'text/css', |
134 | | - integrity: |
135 | | - 'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM', |
136 | | - crossorigin: 'anonymous', |
| 102 | + label: 'Contribute', |
| 103 | + to: '/docs/contribute/how-to-start-contributing', |
| 104 | + }, |
| 105 | + ], |
| 106 | + }, |
| 107 | + { |
| 108 | + title: 'More', |
| 109 | + items: [ |
| 110 | + { |
| 111 | + label: 'GitHub', |
| 112 | + href: 'https://github.com/equinor/tagreader', |
| 113 | + }, |
| 114 | + { |
| 115 | + label: 'PyPi', |
| 116 | + href: 'https://pypi.org/project/tagreader/', |
| 117 | + }, |
| 118 | + ], |
| 119 | + }, |
| 120 | + ], |
| 121 | + copyright: `Built with Docusaurus.`, |
137 | 122 | }, |
138 | | - ], |
139 | | - } |
| 123 | + prism: { |
| 124 | + theme: themes.github, |
| 125 | + darkTheme: themes.dracula, |
| 126 | + }, |
| 127 | + colorMode: { |
| 128 | + defaultMode: 'dark', |
| 129 | + disableSwitch: false, |
| 130 | + respectPrefersColorScheme: true, |
| 131 | + } |
| 132 | + }), |
| 133 | + stylesheets: [ |
| 134 | + { |
| 135 | + href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css', |
| 136 | + type: 'text/css', |
| 137 | + integrity: |
| 138 | + 'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM', |
| 139 | + crossorigin: 'anonymous', |
| 140 | + }, |
| 141 | + ], |
140 | 142 | } |
141 | | - |
142 | | -module.exports = createConfig; |
0 commit comments