Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Docusaurus to V3 #241

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Docusaurus
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x
cache: yarn
- name: Build website
run: |
Expand Down
8 changes: 4 additions & 4 deletions docs/airgap.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ chmod 755 elemental-airgap.sh
```

once completed (the script may take a while) the following files will be available in the current dir:
- elemental-operator-crds-chart-<*VERSION*\>.tgz
- elemental-operator-chart-<*VERSION*\>.tgz
- elemental-images.txt
- elemental-images.tar.gz
- `elemental-operator-crds-chart-<*VERSION*>.tgz`
- `elemental-operator-chart-<*VERSION*>.tgz`
- `elemental-images.txt`
- `elemental-images.tar.gz`

### Perform Elemental installation using the generated artifacts
All the above files should be copied to a host which:
Expand Down
36 changes: 18 additions & 18 deletions docs/hardwarelabels.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ This data can be used for easy identification and selection via a [MachineSelect

The following are available for templating:

| Label | Description |
| ----------------------------------------------------------- | --------------------------------------------------------------------- |
| ${System Data/Memory/Total Physical Bytes} | The total RAM memory in the node, expressed in bytes |
| ${System Data/CPU/Total Cores} | Total CPU cores |
| ${System Data/CPU/Total Threads} | Total CPU threads |
| ${System Data/CPU/Vendor} | CPU vendor |
| ${System Data/CPU/Model} | CPU model |
| ${System Data/GPU/Vendor} | GPU vendor (Only available if the node has an identifiable GPU) |
| ${System Data/GPU/Model} | GPU model (Only available if the node has an identifiable GPU) |
| ${System Data/Network/Number Interfaces} | Number of network interfaces in the system |
| ${System Data/Network/{Iface name}/Name} | Network interface name |
| ${System Data/Network/{Iface name}/IsVirtual} | Boolean indicating virtual network interface |
| ${System Data/Block Devices/Number Devices} | Number of block devices in the system (includes DVD and USB drives) |
| ${System Data/Block Devices/{Disk name}/Name} | Device name of the block device (i.e. sda, sr0, vda, etc...) |
| ${System Data/Block Devices/{Disk name}/Removable} | Whether this block device is removable (i.e. DVD) |
| ${System Data/Block Devices/{Disk name}/Size} | Total space in this block device, expressed in bytes |
| ${System Data/Block Devices/{Disk name}/Drive Type} | Drive type of this block device, see table below |
| ${System Data/Block Devices/{Disk name}/Storage Controller} | Controller type for this block device connection, see table below |
| Label | Description |
| ------------------------------------------------------------- | --------------------------------------------------------------------- |
| `${System Data/Memory/Total Physical Bytes}` | The total RAM memory in the node, expressed in bytes |
| `${System Data/CPU/Total Cores}` | Total CPU cores |
| `${System Data/CPU/Total Threads}` | Total CPU threads |
| `${System Data/CPU/Vendor}` | CPU vendor |
| `${System Data/CPU/Model}` | CPU model |
| `${System Data/GPU/Vendor}` | GPU vendor (Only available if the node has an identifiable GPU) |
| `${System Data/GPU/Model}` | GPU model (Only available if the node has an identifiable GPU) |
| `${System Data/Network/Number Interfaces}` | Number of network interfaces in the system |
| `${System Data/Network/{Iface name}/Name}` | Network interface name |
| `${System Data/Network/{Iface name}/IsVirtual}` | Boolean indicating virtual network interface |
| `${System Data/Block Devices/Number Devices}` | Number of block devices in the system (includes DVD and USB drives) |
| `${System Data/Block Devices/{Disk name}/Name}` | Device name of the block device (i.e. sda, sr0, vda, etc...) |
| `${System Data/Block Devices/{Disk name}/Removable}` | Whether this block device is removable (i.e. DVD) |
| `${System Data/Block Devices/{Disk name}/Size}` | Total space in this block device, expressed in bytes |
| `${System Data/Block Devices/{Disk name}/Drive Type}` | Drive type of this block device, see table below |
| `${System Data/Block Devices/{Disk name}/Storage Controller}` | Controller type for this block device connection, see table below |

:::info info
On both `Block Devices` and `Network` the device name is used as a sub-block, as there could be more than one device.
Expand Down
2 changes: 1 addition & 1 deletion docs/machineinventoryselectortemplate-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:

#### template.spec.selector.matchLabels

It is a map of {key,value} pairs (map[string]string). When multiple labels are provided all labels must match.
It is a map of `{key,value}` pairs `(map[string]string)`. When multiple labels are provided all labels must match.

<details>
<summary>Example</summary>
Expand Down
4 changes: 2 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const lightCodeTheme = require('prism-react-renderer').themes.github;
const darkCodeTheme = require('prism-react-renderer').themes.dracula;

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "^2.4.0",
"@docusaurus/plugin-client-redirects": "^2.4.3",
"@docusaurus/plugin-google-gtag": "^2.4.3",
"@docusaurus/preset-classic": "^2.4.3",
"@mdx-js/react": "^1.6.22",
"@algolia/client-search": "^4.20.0",
"@docusaurus/core": "^3.0.0",
"@docusaurus/plugin-client-redirects": "^3.0.0",
"@docusaurus/plugin-google-gtag": "^3.0.0",
"@docusaurus/preset-classic": "^3.0.0",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"prism-react-renderer": "^1.3.5",
"prism-react-renderer": "^2.2.0",
"raw-loader": "^4.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-loadable": "^5.5.0",
"@algolia/client-search": "^4.20.0",
"webpack": "^5.89.0",
"typescript": "^5.2.2"
"typescript": "^5.3.2",
"webpack": "^5.89.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.4.3"
"@docusaurus/module-type-aliases": "^3.0.0"
},
"browserslist": {
"production": [
Expand All @@ -45,6 +45,6 @@
]
},
"engines": {
"node": ">=16.14"
"node": ">=18.0"
}
}
38 changes: 2 additions & 36 deletions src/theme/MDXComponents/Code.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,8 @@
import React, {isValidElement} from 'react';
import React from 'react';
import CodeBlock from '@theme/CodeBlock';
export default function MDXCode(props) {
const inlineElements = [
'a',
'abbr',
'b',
'br',
'button',
'cite',
'code',
'del',
'dfn',
'em',
'i',
'img',
'input',
'ins',
'kbd',
'label',
'object',
'output',
'q',
'ruby',
's',
'small',
'span',
'strong',
'sub',
'sup',
'time',
'u',
'var',
'wbr',
];
const shouldBeInline = React.Children.toArray(props.children).every(
(el) =>
(typeof el === 'string' && !el.includes('\n')) ||
(isValidElement(el) && inlineElements.includes(el.props?.mdxType)),
(el) => typeof el === 'string' && !el.includes('\n'),
);
return shouldBeInline ? <code {...props} /> : <CodeBlock {...props} />;
}
2 changes: 1 addition & 1 deletion src/theme/MDXComponents/Details.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function MDXDetails(props) {
// Split summary item from the rest to pass it as a separate prop to the
// Details theme component
const summary = items.find(
(item) => React.isValidElement(item) && item.props?.mdxType === 'summary',
(item) => React.isValidElement(item) && item.type === 'summary',
);
const children = <>{items.filter((item) => item !== summary)}</>;
return (
Expand Down
17 changes: 0 additions & 17 deletions src/theme/MDXComponents/Head.js

This file was deleted.

16 changes: 16 additions & 0 deletions src/theme/MDXComponents/Img/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.css';
function transformImgClassName(className) {
return clsx(className, styles.img);
}
export default function MDXImg(props) {
return (
// eslint-disable-next-line jsx-a11y/alt-text
<img
loading="lazy"
{...props}
className={transformImgClassName(props.className)}
/>
);
}
3 changes: 3 additions & 0 deletions src/theme/MDXComponents/Img/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.img {
height: auto;
}
15 changes: 4 additions & 11 deletions src/theme/MDXComponents/Pre.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import React, {isValidElement} from 'react';
import CodeBlock from '@theme/CodeBlock';
import React from 'react';
export default function MDXPre(props) {
return (
<CodeBlock
// If this pre is created by a ``` fenced codeblock, unwrap the children
{...(isValidElement(props.children) &&
props.children.props?.originalType === 'code'
? props.children.props
: {...props})}
/>
);
// With MDX 2, this element is only used for fenced code blocks
// It always receives a MDXComponents/Code as children
return <>{props.children}</>;
}
19 changes: 19 additions & 0 deletions src/theme/MDXComponents/Ul/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.css';
function transformUlClassName(className) {
// Fix https://github.com/facebook/docusaurus/issues/9098
if (typeof className === 'undefined') {
return undefined;
}
return clsx(
className,
// This class is set globally by GitHub/MDX. We keep the global class, and
// add another class to get a task list without the default ul styling
// See https://github.com/syntax-tree/mdast-util-to-hast/issues/28
className?.includes('contains-task-list') && styles.containsTaskList,
);
}
export default function MDXUl(props) {
return <ul {...props} className={transformUlClassName(props.className)} />;
}
7 changes: 7 additions & 0 deletions src/theme/MDXComponents/Ul/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.containsTaskList {
list-style: none;
}

:not(.containsTaskList > li) > .containsTaskList {
padding-left: 0;
}
10 changes: 6 additions & 4 deletions src/theme/MDXComponents/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import MDXHead from '@theme/MDXComponents/Head';
import Head from '@docusaurus/Head';
import MDXCode from '@theme/MDXComponents/Code';
import MDXA from '@theme/MDXComponents/A';
import MDXPre from '@theme/MDXComponents/Pre';
Expand All @@ -8,17 +8,18 @@ import MDXHeading from '@theme/MDXComponents/Heading';
import MDXUl from '@theme/MDXComponents/Ul';
import MDXImg from '@theme/MDXComponents/Img';
import Admonition from '@theme/Admonition';
import Mermaid from '@theme/Mermaid';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';
import Vars from '@site/Vars';

const MDXComponents = {
head: MDXHead,
Head,
details: MDXDetails,
Details: MDXDetails,
code: MDXCode,
a: MDXA,
pre: MDXPre,
details: MDXDetails,
ul: MDXUl,
img: MDXImg,
h1: (props) => <MDXHeading as="h1" {...props} />,
Expand All @@ -28,6 +29,7 @@ const MDXComponents = {
h5: (props) => <MDXHeading as="h5" {...props} />,
h6: (props) => <MDXHeading as="h6" {...props} />,
admonition: Admonition,
mermaid: Mermaid,
Tabs,
TabItem,
CodeBlock,
Expand Down
36 changes: 18 additions & 18 deletions versioned_docs/version-1.2/hardwarelabels.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ This data can be used for easy identification and selection via a [MachineSelect

The following are available for templating:

| Label | Description |
| ----------------------------------------------------------- | --------------------------------------------------------------------- |
| ${System Data/Memory/Total Physical Bytes} | The total RAM memory in the node, expressed in bytes |
| ${System Data/CPU/Total Cores} | Total CPU cores |
| ${System Data/CPU/Total Threads} | Total CPU threads |
| ${System Data/CPU/Vendor} | CPU vendor |
| ${System Data/CPU/Model} | CPU model |
| ${System Data/GPU/Vendor} | GPU vendor (Only available if the node has an identifiable GPU) |
| ${System Data/GPU/Model} | GPU model (Only available if the node has an identifiable GPU) |
| ${System Data/Network/Number Interfaces} | Number of network interfaces in the system |
| ${System Data/Network/{Iface name}/Name} | Network interface name |
| ${System Data/Network/{Iface name}/IsVirtual} | Boolean indicating virtual network interface |
| ${System Data/Block Devices/Number Devices} | Number of block devices in the system (includes DVD and USB drives) |
| ${System Data/Block Devices/{Disk name}/Name} | Device name of the block device (i.e. sda, sr0, vda, etc...) |
| ${System Data/Block Devices/{Disk name}/Removable} | Whether this block device is removable (i.e. DVD) |
| ${System Data/Block Devices/{Disk name}/Size} | Total space in this block device, expressed in bytes |
| ${System Data/Block Devices/{Disk name}/Drive Type} | Drive type of this block device, see table below |
| ${System Data/Block Devices/{Disk name}/Storage Controller} | Controller type for this block device connection, see table below |
| Label | Description |
| ------------------------------------------------------------- | --------------------------------------------------------------------- |
| `${System Data/Memory/Total Physical Bytes}` | The total RAM memory in the node, expressed in bytes |
| `${System Data/CPU/Total Cores}` | Total CPU cores |
| `${System Data/CPU/Total Threads}` | Total CPU threads |
| `${System Data/CPU/Vendor}` | CPU vendor |
| `${System Data/CPU/Model}` | CPU model |
| `${System Data/GPU/Vendor}` | GPU vendor (Only available if the node has an identifiable GPU) |
| `${System Data/GPU/Model}` | GPU model (Only available if the node has an identifiable GPU) |
| `${System Data/Network/Number Interfaces}` | Number of network interfaces in the system |
| `${System Data/Network/{Iface name}/Name}` | Network interface name |
| `${System Data/Network/{Iface name}/IsVirtual}` | Boolean indicating virtual network interface |
| `${System Data/Block Devices/Number Devices}` | Number of block devices in the system (includes DVD and USB drives) |
| `${System Data/Block Devices/{Disk name}/Name}` | Device name of the block device (i.e. sda, sr0, vda, etc...) |
| `${System Data/Block Devices/{Disk name}/Removable}` | Whether this block device is removable (i.e. DVD) |
| `${System Data/Block Devices/{Disk name}/Size}` | Total space in this block device, expressed in bytes |
| `${System Data/Block Devices/{Disk name}/Drive Type}` | Drive type of this block device, see table below |
| `${System Data/Block Devices/{Disk name}/Storage Controller}` | Controller type for this block device connection, see table below |

:::info info
On both `Block Devices` and `Network` the device name is used as a sub-block, as there could be more than one device.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:

#### template.spec.selector.matchLabels

It is a map of {key,value} pairs (map[string]string). When multiple labels are provided all labels must match.
It is a map of `{key,value}` pairs `(map[string]string)`. When multiple labels are provided all labels must match.

<details>
<summary>Example</summary>
Expand Down
Loading