mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-03 19:32:35 +02:00
feat: upgrade to MDX v2 (#8288)
Co-authored-by: Armano <armano2@users.noreply.github.com>
This commit is contained in:
parent
10f161d578
commit
bf913aea2a
161 changed files with 4028 additions and 2821 deletions
|
@ -7,7 +7,6 @@
|
|||
// @ts-check
|
||||
|
||||
const path = require('path');
|
||||
const math = require('remark-math');
|
||||
const npm2yarn = require('@docusaurus/remark-plugin-npm2yarn');
|
||||
const versions = require('./versions.json');
|
||||
const VersionsArchived = require('./versionsArchived.json');
|
||||
|
@ -140,6 +139,20 @@ module.exports = async function createConfigAsync() {
|
|||
},
|
||||
markdown: {
|
||||
mermaid: true,
|
||||
mdx1Compat: {
|
||||
// comments: false,
|
||||
},
|
||||
preprocessor: ({filePath, fileContent}) => {
|
||||
if (isDev) {
|
||||
// "vscode://file/${projectPath}${filePath}:${line}:${column}",
|
||||
// "webstorm://open?file=${projectPath}${filePath}&line=${line}&column=${column}",
|
||||
const vscodeLink = `vscode://file/${filePath}`;
|
||||
const webstormLink = `webstorm://open?file=${filePath}`;
|
||||
const intellijLink = `idea://open?file=${filePath}`;
|
||||
return `${fileContent}\n\n---\n\n**DEV**: open this file in [VSCode](<${vscodeLink}>) | [WebStorm](<${webstormLink}>) | [IntelliJ](<${intellijLink}>)\n`;
|
||||
}
|
||||
return fileContent;
|
||||
},
|
||||
},
|
||||
onBrokenLinks: 'throw',
|
||||
onBrokenMarkdownLinks: 'warn',
|
||||
|
@ -331,13 +344,12 @@ module.exports = async function createConfigAsync() {
|
|||
},
|
||||
admonitions: {
|
||||
keywords: ['my-custom-admonition'],
|
||||
extendDefaults: true,
|
||||
},
|
||||
showLastUpdateAuthor: true,
|
||||
showLastUpdateTime: true,
|
||||
remarkPlugins: [
|
||||
math,
|
||||
[npm2yarn, {sync: true}],
|
||||
(await import('remark-math')).default,
|
||||
(await import('./src/remark/configTabs.mjs')).default,
|
||||
],
|
||||
rehypePlugins: [(await import('rehype-katex')).default],
|
||||
|
@ -346,6 +358,7 @@ module.exports = async function createConfigAsync() {
|
|||
isDev || isDeployPreview || isBranchDeploy
|
||||
? 'current'
|
||||
: undefined,
|
||||
|
||||
onlyIncludeVersions: (() => {
|
||||
if (isBuildFast) {
|
||||
return ['current'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue