Skip to content

Commit 261c573

Browse files
committed
build: upgrade Docusaurus
1 parent 719f09a commit 261c573

6 files changed

Lines changed: 4286 additions & 2610 deletions

File tree

.github/workflows/docs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
uses: actions/checkout@v4
1919

2020
- name: Setup node
21-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v4
2222
with:
23-
node-version: 18
23+
node-version: 20
2424
cache: yarn
2525
cache-dependency-path: documentation/yarn.lock
2626

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
rev: '6.0.0'
1717
hooks:
1818
- id: flake8
19-
args: ['--ignore=E501,W503,E231,E503,E203,F401']
19+
args: ['--ignore=E501,W503,E231,E503,E203,F401,E702']
2020

2121
- repo: https://github.com/timothycrosley/isort
2222
rev: '5.12.0'

.snyk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
2+
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
3+
ignore:
4+
SNYK-JS-INFLIGHT-6095116:
5+
- '*':
6+
reason: 'No patch available, false positive'
7+
expires: 2024-11-30T00:00:00.000Z
8+
created: 2023-12-04T09:05:00.000Z
9+
patch: {}
10+
version: v1.25.0

documentation/docusaurus.config.js

Lines changed: 126 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,142 @@
11
// @ts-check
22
// Note: type annotations allow type checking and IDEs autocompletion
33

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';
98

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+
],
2023

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',
2629

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: [
3439

35-
plugins: [
40+
],
3641

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+
}),
3759
],
60+
],
3861

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',
5077
},
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',
5483
},
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',
6788
},
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+
},
111101
{
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.`,
137122
},
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+
],
140142
}
141-
142-
module.exports = createConfig;

documentation/package.json

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,19 @@
1616
},
1717
"dependencies": {
1818
"@akebifiky/remark-simple-plantuml": "^1.0.2",
19-
"@docusaurus/core": "^2.4.1",
20-
"@docusaurus/preset-classic": "^2.4.1",
21-
"@mdx-js/react": "^1.6.22",
22-
"clsx": "^1.2.1",
23-
"hast-util-is-element": "1.1.0",
24-
"mdx-mermaid": "^1.3.2",
25-
"mermaid": "^9.1.7",
26-
"prism-react-renderer": "^1.3.5",
27-
"react": "^17.0.2",
28-
"react-dom": "^17.0.2",
29-
"rehype-katex": "5",
30-
"remark-math": "3"
19+
"@docusaurus/core": "^3.0.1",
20+
"@docusaurus/preset-classic": "^3.0.1",
21+
"@docusaurus/theme-mermaid": "^3.0.1",
22+
"@mdx-js/react": "^3.0.0",
23+
"prism-react-renderer": "^2.3.0",
24+
"react": "^18.2.0",
25+
"react-dom": "^18.2.0",
26+
"rehype-katex": "7.0.0",
27+
"remark-math": "6.0.0"
3128
},
3229
"devDependencies": {
33-
"@docusaurus/module-type-aliases": "^2.4.1",
34-
"@tsconfig/docusaurus": "^1.0.5",
35-
"raw-loader": "^4.0.2",
36-
"typescript": "^4.7.4"
30+
"@tsconfig/docusaurus": "^2.0.2",
31+
"typescript": "^5.3.2"
3732
},
3833
"browserslist": {
3934
"production": [
@@ -48,6 +43,6 @@
4843
]
4944
},
5045
"engines": {
51-
"node": ">=16.14"
46+
"node": ">=20.0"
5247
}
5348
}

0 commit comments

Comments
 (0)