-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated Docusaurus to V3 To upgrade to Docusaurus V3, the following actions have been performed: - Local machine: install node.js `>=18.x` - Upgrade the Docusaurus modules with the command `yarn upgrade @docusaurus/core@latest @docusaurus/plugin-client-redirects@latest @docusaurus/plugin-google-gtag@latest @docusaurus/preset-classic@latest @docusaurus/module-type-aliases@lates` - Update `yarn.lock` with the required values: - "@docusaurus/core": "3.0.0" - "@docusaurus/preset-classic": "3.0.0" - "@mdx-js/react": "^3.0.0" - "prism-react-renderer": "^2.1.0" - "react": "^18.2.0" - "react-dom": "^18.2.0" - "node": ">=18.0" - The themes light and dark imports in `docusaurus.config.js` have been updated to use the MDX V3 syntax - The `deploy.yml` action file has been updated to use node.js `>=18.x` - Due to Docusaurus V3 using MDX V3, the references using `{ ... }` have been formatted as code to void errors - The `theme/MDXComponents` file has been regenerated and updated with the previous values. This avoids errors with `details` component. - The file `package-lock.json` has been removed This PR also addresses: #55 / #238 / #240 Signed-off-by: Nuno do Carmo [email protected] * Updated typescript module Addresses #242 --------- Signed-off-by: Nuno do Carmo [email protected]
- Loading branch information
Showing
20 changed files
with
3,965 additions
and
3,223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.img { | ||
height: auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}</>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.