diff --git a/packages/docusaurus/config/remark/autoLink.ts b/packages/docusaurus/config/remark/autoLink.ts index ba3d41e2d5e1..4b9f6bd9b0d5 100644 --- a/packages/docusaurus/config/remark/autoLink.ts +++ b/packages/docusaurus/config/remark/autoLink.ts @@ -49,10 +49,16 @@ export const plugin = (userSpecs: Array) => () => { for (const segment of segments) { if (node.type === `object`) { - if (!Object.hasOwn(node.properties, segment)) + const bareSegment = segment.replace(`[]`, ``); + if (node.properties == null || !Object.hasOwn(node.properties, bareSegment)) return false; - node = node.properties[segment]; + node = node.properties[bareSegment]; + + if (segment.endsWith(`[]`) && node.patternProperties != null) { + const key = Object.keys(node.patternProperties)[0]; + node = node.patternProperties[key]; + } } } @@ -60,7 +66,7 @@ export const plugin = (userSpecs: Array) => () => { return false; const url = !ancestors.find(ancestor => ancestor.type === `link`) - ? spec.urlGenerator(segments.join(`.`)) + ? spec.urlGenerator(segments.map(i => i.replace(`[]`, ``)).join(`.`)) : null; result = { diff --git a/packages/docusaurus/src/css/custom.css b/packages/docusaurus/src/css/custom.css index 60f2e5682f97..da6489a337b3 100644 --- a/packages/docusaurus/src/css/custom.css +++ b/packages/docusaurus/src/css/custom.css @@ -256,6 +256,10 @@ html.search-page-wrapper .row { color: rgb(156, 220, 254); } +.rjd-annotation a code { + cursor: pointer; +} + .terminal-code pre { --prism-background-color: #393A34 !important; --prism-color: #f6f8fa !important; diff --git a/packages/docusaurus/static/configuration/manifest.json b/packages/docusaurus/static/configuration/manifest.json index e83d50ff6af0..e8aac5474f1d 100644 --- a/packages/docusaurus/static/configuration/manifest.json +++ b/packages/docusaurus/static/configuration/manifest.json @@ -219,7 +219,7 @@ "properties": { "built": { "title": "Define whether to run the postinstall script or not.", - "description": "If false, the package will never be built (deny-list). This behavior is reversed when the `enableScripts` yarnrc setting is toggled off - when that happens, only packages with `built` explicitly set to `true` will be built (allow-list); as for those with `built` explicitly set to `false`, they will simply see their build script warnings downgraded into simple notices.", + "description": "If false, the package will never be built (deny-list). This behavior is reversed when the [`enableScripts` yarnrc setting](yarnrc#enableScripts) is toggled off - when that happens, only packages with `built` explicitly set to `true` will be built (allow-list); as for those with `built` explicitly set to `false`, they will simply see their build script warnings downgraded into simple notices.", "type": "boolean", "examples": [false] }, diff --git a/packages/docusaurus/static/configuration/yarnrc.json b/packages/docusaurus/static/configuration/yarnrc.json index 97ed444e8d15..9ed8709933b8 100644 --- a/packages/docusaurus/static/configuration/yarnrc.json +++ b/packages/docusaurus/static/configuration/yarnrc.json @@ -217,7 +217,7 @@ "enableScripts": { "_package": "@yarnpkg/core", "title": "Define whether to run postinstall scripts or not.", - "description": "If false, Yarn will not execute the `postinstall` scripts from third-party packages when installing the project (workspaces will still see their postinstall scripts evaluated, as they're assumed to be safe if you're running an install within them).\n\nNote that you also have the ability to disable scripts on a per-package basis using `dependenciesMeta`, or to re-enable a specific script by combining `enableScripts` and `dependenciesMeta`.", + "description": "If false, Yarn will not execute the `postinstall` scripts from third-party packages when installing the project (workspaces will still see their postinstall scripts evaluated, as they're assumed to be safe if you're running an install within them).\n\nNote that you also have the ability to disable scripts on a per-package basis using [`dependenciesMeta[].built`](manifest#dependenciesMeta.built), or to re-enable a specific script by combining `enableScripts` and [`dependenciesMeta[].built`](manifest#dependenciesMeta.built).", "type": "boolean", "default": true },