mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-28 17:57:48 +02:00
22 lines
No EOL
61 KiB
JavaScript
22 lines
No EOL
61 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["25467"],{84645:function(e,n,t){t.d(n,{ZP:()=>l,d$:()=>i});var s=t(85893),r=t(80980);let i=[{value:"Tags File",id:"tags-file",level:2},{value:"Types",id:"tags-file-types",level:3},{value:"Example",id:"tags-file-example",level:3}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"tags-file",children:"Tags File"}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsxs)(n.a,{href:"#tags",children:[(0,s.jsx)(n.code,{children:"tags"})," plugin option"]})," to configure the path of a YAML tags file."]}),"\n",(0,s.jsxs)(n.p,{children:["By convention, the plugin will look for a ",(0,s.jsx)(n.code,{children:"tags.yml"})," file at the root of your content folder(s)."]}),"\n",(0,s.jsxs)(n.p,{children:["This file can contain a list of predefined tags. You can reference these tags by their keys in Markdown files thanks to the ",(0,s.jsxs)(n.a,{href:"#markdown-front-matter",children:[(0,s.jsx)(n.code,{children:"tags"})," front matter"]}),"."]}),"\n",(0,s.jsx)(n.admonition,{title:"Keeping tags consistent",type:"tip",children:(0,s.jsxs)(n.p,{children:["Using a tags file, you can ensure that your tags usage is consistent across your plugin content set. Use the ",(0,s.jsx)(n.a,{href:"#onInlineTags",children:(0,s.jsx)(n.code,{children:"onInlineTags: 'throw'"})})," plugin option to enforce this consistency and prevent usage of inline tags declared on the fly."]})}),"\n",(0,s.jsx)(n.h3,{id:"tags-file-types",children:"Types"}),"\n",(0,s.jsx)(n.p,{children:"The YAML content of the provided tags file should respect the following shape:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-tsx",children:"type Tag = {\n label?: string; // Tag display label\n permalink?: string; // Tag URL pathname segment\n description?: string; // Tag description displayed in the tag page\n};\n\ntype TagsFileInput = Record<string, Partial<Tag> | null>;\n"})}),"\n",(0,s.jsx)(n.h3,{id:"tags-file-example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yml",metastring:'title="tags.yml"',children:"releases:\n label: 'Product releases'\n permalink: '/product-releases'\n description: 'Content related to product releases.'\n\n# A partial tag definition is also valid\nannouncements:\n label: 'Announcements'\n\n# An empty tag definition is also valid\n# Other attributes will be inferred from the key\nemptyTag:\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-md",metastring:'title="content.md"',children:"---\ntags: [releases, announcements, emptyTag]\n---\n\n# Title\n\nContent\n"})})]})}function l(e={}){let{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},17918:function(e,n,t){t.r(n),t.d(n,{frontMatter:()=>h,default:()=>g,contentTitle:()=>u,assets:()=>x,toc:()=>j,metadata:()=>s});var s=JSON.parse('{"id":"api/plugins/plugin-content-docs","title":"\uD83D\uDCE6 plugin-content-docs","description":"Provides the Docs functionality and is the default docs plugin for Docusaurus.","source":"@site/docs/api/plugins/plugin-content-docs.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-content-docs","permalink":"/docs/api/plugins/@docusaurus/plugin-content-docs","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-content-docs.mdx","tags":[],"version":"current","lastUpdatedBy":"dependabot[bot]","lastUpdatedAt":1744702265000,"sidebarPosition":1,"frontMatter":{"sidebar_position":1,"slug":"/api/plugins/@docusaurus/plugin-content-docs"},"sidebar":"api","previous":{"title":"Plugins overview","permalink":"/docs/api/plugins"},"next":{"title":"\uD83D\uDCE6 plugin-content-blog","permalink":"/docs/api/plugins/@docusaurus/plugin-content-blog"}}'),r=t(85893),i=t(80980),d=t(15398),l=t(58636),o=t(32240),c=t(66359),a=t(84645);let h={sidebar_position:1,slug:"/api/plugins/@docusaurus/plugin-content-docs"},u="\uD83D\uDCE6 plugin-content-docs",x={},j=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Types",id:"types",level:3},{value:"<code>EditUrlFunction</code>",id:"EditUrlFunction",level:4},{value:"<code>PrefixParser</code>",id:"PrefixParser",level:4},{value:"<code>SidebarGenerator</code>",id:"SidebarGenerator",level:4},{value:"<code>VersionsConfig</code>",id:"VersionsConfig",level:4},{value:"Example configuration",id:"ex-config",level:3},{value:"Markdown front matter",id:"markdown-front-matter",level:2},...a.d$,{value:"i18n",id:"i18n",level:2},{value:"Translation files location",id:"translation-files-location",level:3},{value:"Example file-system structure",id:"example-file-system-structure",level:3}];function p(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"-plugin-content-docs",children:"\uD83D\uDCE6 plugin-content-docs"})}),"\n","\n",(0,r.jsxs)(n.p,{children:["Provides the ",(0,r.jsx)(n.a,{href:"/docs/docs-introduction",children:"Docs"})," functionality and is the default docs plugin for Docusaurus."]}),"\n",(0,r.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,r.jsxs)(d.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(l.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-content-docs\n"})})}),(0,r.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-content-docs\n"})})}),(0,r.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-content-docs\n"})})}),(0,r.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun add @docusaurus/plugin-content-docs\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.p,{children:["If you use the preset ",(0,r.jsx)(n.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,r.jsxs)(n.p,{children:["You can configure this plugin through the ",(0,r.jsx)(n.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,r.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,r.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"path"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'docs'"})}),(0,r.jsx)(n.td,{children:"Path to the docs content directory on the file system, relative to site directory."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"editUrl"})}),(0,r.jsx)(n.td,{children:(0,r.jsxs)("code",{children:["string | ",(0,r.jsx)(n.a,{href:"#EditUrlFunction",children:"EditUrlFunction"})]})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Base URL to edit your site. The final URL is computed by ",(0,r.jsx)(n.code,{children:"editUrl + relativeDocPath"}),". Using a function allows more nuanced control for each file. Omitting this variable entirely will disable edit links."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"editLocalizedFiles"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["The edit URL will target the localized file, instead of the original unlocalized file. Ignored when ",(0,r.jsx)(n.code,{children:"editUrl"})," is a function."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"editCurrentVersion"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["The edit URL will always target the current version doc instead of older versions. Ignored when ",(0,r.jsx)(n.code,{children:"editUrl"})," is a function."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"routeBasePath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'docs'"})}),(0,r.jsxs)(n.td,{children:["URL route for the docs section of your site. ",(0,r.jsx)(n.strong,{children:"DO NOT"})," include a trailing slash. Use ",(0,r.jsx)(n.code,{children:"/"})," for shipping docs without base path."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tagsBasePath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'tags'"})}),(0,r.jsxs)(n.td,{children:["URL route for the tags list page of your site. It is prepended to the ",(0,r.jsx)(n.code,{children:"routeBasePath"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"include"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"['**/*.{md,mdx}']"})}),(0,r.jsx)(n.td,{children:"Array of glob patterns matching Markdown files to be built, relative to the content path."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"exclude"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.em,{children:"See example configuration"})}),(0,r.jsxs)(n.td,{children:["Array of glob patterns matching Markdown files to be excluded. Serves as refinement based on the ",(0,r.jsx)(n.code,{children:"include"})," option."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebarPath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"false | string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Path to a sidebars configuration file, loaded in a Node.js context. Use ",(0,r.jsx)(n.code,{children:"false"})," to disable sidebars, or ",(0,r.jsx)(n.code,{children:"undefined"})," to create a fully autogenerated sidebar."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebarCollapsible"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"true"})}),(0,r.jsxs)(n.td,{children:["Whether sidebar categories are collapsible by default. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/items#collapsible-categories",children:"Collapsible categories"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebarCollapsed"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"true"})}),(0,r.jsxs)(n.td,{children:["Whether sidebar categories are collapsed by default. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/items#expanded-categories-by-default",children:"Expanded categories by default"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebarItemsGenerator"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:(0,r.jsx)(n.a,{href:"#SidebarGenerator",children:"SidebarGenerator"})})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.em,{children:"Omitted"})}),(0,r.jsxs)(n.td,{children:["Function used to replace the sidebar items of type ",(0,r.jsx)(n.code,{children:"'autogenerated'"})," with real sidebar items (docs, categories, links...). See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/autogenerated#customize-the-sidebar-items-generator",children:"Customize the sidebar items generator"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"numberPrefixParser"})}),(0,r.jsx)(n.td,{children:(0,r.jsxs)("code",{children:["boolean | ",(0,r.jsx)(n.a,{href:"#PrefixParser",children:"PrefixParser"})]})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.em,{children:"Omitted"})}),(0,r.jsxs)(n.td,{children:["Custom parsing logic to extract number prefixes from file names. Use ",(0,r.jsx)(n.code,{children:"false"})," to disable this behavior and leave the docs untouched, and ",(0,r.jsx)(n.code,{children:"true"})," to use the default parser. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/autogenerated#using-number-prefixes",children:"Using number prefixes"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docsRootComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocsRoot'"})}),(0,r.jsx)(n.td,{children:"Parent component of all the docs plugin pages (including all versions). Stays mounted when navigation between docs pages and versions."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docVersionRootComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocVersionLayout'"})}),(0,r.jsx)(n.td,{children:"Parent component of all docs pages of an individual version (doc pages with sidebars, tags pages). Stays mounted when navigation between pages of that specific version."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docRootComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocRoot'"})}),(0,r.jsx)(n.td,{children:"Parent component of all doc pages with sidebars (regular docs pages, category generated index pages). Stays mounted when navigation between such pages."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docItemComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocItem'"})}),(0,r.jsx)(n.td,{children:"Main doc container, with TOC, pagination, etc."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docTagsListComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocTagsListPage'"})}),(0,r.jsx)(n.td,{children:"Root component of the tags list page"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docTagDocListComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocTagDocListPage'"})}),(0,r.jsx)(n.td,{children:'Root component of the "docs containing tag X" page.'})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docCategoryGeneratedIndexComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocCategoryGeneratedIndexPage'"})}),(0,r.jsx)(n.td,{children:"Root component of the generated category index page."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"remarkPlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Remark plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"rehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Rehype plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"rehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Recma plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"beforeDefaultRemarkPlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"beforeDefaultRehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"showLastUpdateAuthor"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Whether to display the author who last updated the doc."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"showLastUpdateTime"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["Whether to display the last date the doc was updated. This requires access to git history during the build, so will not work correctly with shallow clones (a common default for CI systems). With GitHub ",(0,r.jsx)(n.code,{children:"actions/checkout"}),", use",(0,r.jsx)(n.code,{children:"fetch-depth: 0"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"breadcrumbs"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"true"})}),(0,r.jsx)(n.td,{children:"Enable or disable the breadcrumbs on doc pages."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"disableVersioning"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["Explicitly disable versioning even when multiple versions exist. This will make the site only include the current version. Will error if ",(0,r.jsx)(n.code,{children:"includeCurrentVersion: false"})," and ",(0,r.jsx)(n.code,{children:"disableVersioning: true"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"includeCurrentVersion"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"true"})}),(0,r.jsx)(n.td,{children:"Include the current version of your docs."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"lastVersion"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsxs)(n.td,{children:["First version in ",(0,r.jsx)(n.code,{children:"versions.json"})]}),(0,r.jsx)(n.td,{children:"The version navigated to in priority and displayed by default for docs navbar items."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"onlyIncludeVersions"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:"All versions available"}),(0,r.jsx)(n.td,{children:"Only include a subset of all available versions."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"versions"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:(0,r.jsx)(n.a,{href:"#VersionsConfig",children:"VersionsConfig"})})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"{}"})}),(0,r.jsx)(n.td,{children:"Independent customization of each version's properties."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tags"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string | false | null | undefined"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tags.yml"})}),(0,r.jsx)(n.td,{children:"Path to a YAML file listing pre-defined tags. Relative to the docs version content directories."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"onInlineTags"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'ignore' | 'log' | 'warn' | 'throw'"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"warn"})}),(0,r.jsxs)(n.td,{children:["The plugin behavior when docs contain inline tags (not appearing in the list of pre-defined tags, usually ",(0,r.jsx)(n.code,{children:"docs/tags.yml"}),")."]})]})]})]})}),"\n",(0,r.jsx)(n.h3,{id:"types",children:"Types"}),"\n",(0,r.jsx)(n.h4,{id:"EditUrlFunction",children:(0,r.jsx)(n.code,{children:"EditUrlFunction"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type EditUrlFunction = (params: {\n version: string;\n versionDocsDirPath: string;\n docPath: string;\n permalink: string;\n locale: string;\n}) => string | undefined;\n"})}),"\n",(0,r.jsx)(n.h4,{id:"PrefixParser",children:(0,r.jsx)(n.code,{children:"PrefixParser"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type PrefixParser = (filename: string) => {\n filename: string;\n numberPrefix?: number;\n};\n"})}),"\n",(0,r.jsx)(n.h4,{id:"SidebarGenerator",children:(0,r.jsx)(n.code,{children:"SidebarGenerator"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type SidebarGenerator = (generatorArgs: {\n /** The sidebar item with type \"autogenerated\" to be transformed. */\n item: {type: 'autogenerated'; dirName: string};\n /** Useful metadata for the version this sidebar belongs to. */\n version: {contentPath: string; versionName: string};\n /** All the docs of that version (unfiltered). */\n docs: {\n id: string;\n title: string;\n frontMatter: DocFrontMatter & Record<string, unknown>;\n source: string;\n sourceDirName: string;\n sidebarPosition?: number | undefined;\n }[];\n /** Number prefix parser configured for this plugin. */\n numberPrefixParser: PrefixParser;\n /** The default category index matcher which you can override. */\n isCategoryIndex: CategoryIndexMatcher;\n /**\n * key is the path relative to the doc content directory, value is the\n * category metadata file's content.\n */\n categoriesMetadata: {[filePath: string]: CategoryMetadata};\n /**\n * Useful to re-use/enhance the default sidebar generation logic from\n * Docusaurus.\n */\n defaultSidebarItemsGenerator: SidebarGenerator;\n // Returns an array of sidebar items \u2014 same as what you can declare in\n // sidebars.js, except for shorthands. See https://docusaurus.io/docs/sidebar/items\n}) => Promise<SidebarItem[]>;\n\ntype CategoryIndexMatcher = (param: {\n /** The file name, without extension */\n fileName: string;\n /**\n * The list of directories, from lowest level to highest.\n * If there's no dir name, directories is ['.']\n */\n directories: string[];\n /** The extension, with a leading dot */\n extension: string;\n}) => boolean;\n"})}),"\n",(0,r.jsx)(n.h4,{id:"VersionsConfig",children:(0,r.jsx)(n.code,{children:"VersionsConfig"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type VersionConfig = {\n /**\n * The base path of the version, will be appended to `baseUrl` +\n * `routeBasePath`.\n */\n path?: string;\n /** The label of the version to be used in badges, dropdowns, etc. */\n label?: string;\n /** The banner to show at the top of a doc of that version. */\n banner?: 'none' | 'unreleased' | 'unmaintained';\n /** Show a badge with the version label at the top of each doc. */\n badge?: boolean;\n /** Prevents search engines from indexing this version */\n noIndex?: boolean;\n /** Add a custom class name to the <html> element of each doc */\n className?: string;\n};\n\ntype VersionsConfig = {[versionName: string]: VersionConfig};\n"})}),"\n",(0,r.jsx)(n.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,r.jsx)(n.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsx)(n.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,r.jsx)(c.Z,{pluginName:"@docusaurus/plugin-content-docs",presetOptionName:"docs",code:"{\n path: 'docs',\n breadcrumbs: true,\n // Simple use-case: string editUrl\n // editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',\n // Advanced use-case: functional editUrl\n editUrl: ({versionDocsDirPath, docPath}) =>\n `https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`,\n editLocalizedFiles: false,\n editCurrentVersion: false,\n routeBasePath: 'docs',\n include: ['**/*.md', '**/*.mdx'],\n exclude: [\n '**/_*.{js,jsx,ts,tsx,md,mdx}',\n '**/_*/**',\n '**/*.test.{js,jsx,ts,tsx}',\n '**/__tests__/**',\n ],\n sidebarPath: 'sidebars.js',\n async sidebarItemsGenerator({\n defaultSidebarItemsGenerator,\n numberPrefixParser,\n item,\n version,\n docs,\n isCategoryIndex,\n }) {\n // Use the provided data to generate a custom sidebar slice\n return [\n {type: 'doc', id: 'intro'},\n {\n type: 'category',\n label: 'Tutorials',\n items: [\n {type: 'doc', id: 'tutorial1'},\n {type: 'doc', id: 'tutorial2'},\n ],\n },\n ];\n },\n numberPrefixParser(filename) {\n // Implement your own logic to extract a potential number prefix\n const numberPrefix = findNumberPrefix(filename);\n // Prefix found: return it with the cleaned filename\n if (numberPrefix) {\n return {\n numberPrefix,\n filename: filename.replace(prefix, ''),\n };\n }\n // No number prefix found\n return {numberPrefix: undefined, filename};\n },\n docsRootComponent: '@theme/DocsRoot',\n docVersionRootComponent: '@theme/DocVersionRoot',\n docRootComponent: '@theme/DocRoot',\n docItemComponent: '@theme/DocItem',\n remarkPlugins: [require('./my-remark-plugin')],\n rehypePlugins: [],\n beforeDefaultRemarkPlugins: [],\n beforeDefaultRehypePlugins: [],\n showLastUpdateAuthor: false,\n showLastUpdateTime: false,\n disableVersioning: false,\n includeCurrentVersion: true,\n lastVersion: undefined,\n versions: {\n current: {\n label: 'Android SDK v2.0.0 (WIP)',\n path: 'android-2.0.0',\n banner: 'none',\n },\n '1.0.0': {\n label: 'Android SDK v1.0.0',\n path: 'android-1.0.0',\n banner: 'unmaintained',\n },\n },\n onlyIncludeVersions: ['current', '1.0.0', '2.0.0'],\n}"}),"\n",(0,r.jsx)(n.h2,{id:"markdown-front-matter",children:"Markdown front matter"}),"\n",(0,r.jsxs)(n.p,{children:["Markdown documents can use the following Markdown ",(0,r.jsx)(n.a,{href:"/docs/markdown-features#front-matter",children:"front matter"})," metadata fields, enclosed by a line ",(0,r.jsx)(n.code,{children:"---"})," on either side."]}),"\n",(0,r.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"id"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"file path (including folders, without the extension)"}),(0,r.jsx)(n.td,{children:"A unique document ID."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"title"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsxs)(n.td,{children:["Markdown title or ",(0,r.jsx)(n.code,{children:"id"})]}),(0,r.jsx)(n.td,{children:"The text title of your document. Used for the page metadata and as a fallback value in multiple places (sidebar, next/previous buttons...). Automatically added at the top of your doc if it does not contain any Markdown title."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"pagination_label"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"sidebar_label"})," or ",(0,r.jsx)(n.code,{children:"title"})]}),(0,r.jsx)(n.td,{children:"The text used in the document next/previous buttons for this document."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebar_label"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"title"})}),(0,r.jsx)(n.td,{children:"The text shown in the document sidebar for this document."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebar_position"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"number"})}),(0,r.jsx)(n.td,{children:"Default ordering"}),(0,r.jsxs)(n.td,{children:["Controls the position of a doc inside the generated sidebar slice when using ",(0,r.jsx)(n.code,{children:"autogenerated"})," sidebar items. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/autogenerated#autogenerated-sidebar-metadata",children:"Autogenerated sidebar metadata"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebar_class_name"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsx)(n.td,{children:"Gives the corresponding sidebar label a special class name when using autogenerated sidebars."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebar_custom_props"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"object"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Assign ",(0,r.jsx)(n.a,{href:"/docs/sidebar#passing-custom-props",children:"custom props"})," to the sidebar item referencing this doc"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"displayed_sidebar"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Force the display of a given sidebar when browsing the current document. Read the ",(0,r.jsx)(n.a,{href:"/docs/sidebar/multiple-sidebars",children:"multiple sidebars guide"})," for details."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"hide_title"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Whether to hide the title at the top of the doc. It only hides a title declared through the front matter, and have no effect on a Markdown title at the top of your document."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"hide_table_of_contents"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Whether to hide the table of contents to the right."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"toc_min_heading_level"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"number"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"2"})}),(0,r.jsx)(n.td,{children:"The minimum heading level shown in the table of contents. Must be between 2 and 6 and lower or equal to the max value."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"toc_max_heading_level"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"number"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"3"})}),(0,r.jsx)(n.td,{children:"The max heading level shown in the table of contents. Must be between 2 and 6."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"pagination_next"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"string | null"})}),(0,r.jsx)(n.td,{children:"Next doc in the sidebar"}),(0,r.jsxs)(n.td,{children:['The ID of the documentation you want the "Next" pagination to link to. Use ',(0,r.jsx)(n.code,{children:"null"}),' to disable showing "Next" for this page.']})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"pagination_prev"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"string | null"})}),(0,r.jsx)(n.td,{children:"Previous doc in the sidebar"}),(0,r.jsxs)(n.td,{children:['The ID of the documentation you want the "Previous" pagination to link to. Use ',(0,r.jsx)(n.code,{children:"null"}),' to disable showing "Previous" for this page.']})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"parse_number_prefixes"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"numberPrefixParser"})," plugin option"]}),(0,r.jsxs)(n.td,{children:["Whether number prefix parsing is disabled on this doc. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/autogenerated#using-number-prefixes",children:"Using number prefixes"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"custom_edit_url"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"string | null"})}),(0,r.jsxs)(n.td,{children:["Computed using the ",(0,r.jsx)(n.code,{children:"editUrl"})," plugin option"]}),(0,r.jsxs)(n.td,{children:["The URL for editing this document. Use ",(0,r.jsx)(n.code,{children:"null"}),' to disable showing "Edit this page" for this page.']})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"keywords"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsx)(n.td,{children:"Keywords meta tag for the document page, for search engines."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"description"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"The first line of Markdown content"}),(0,r.jsxs)(n.td,{children:["The description of your document, which will become the ",(0,r.jsx)(n.code,{children:'<meta name="description" content="..."/>'})," and ",(0,r.jsx)(n.code,{children:'<meta property="og:description" content="..."/>'})," in ",(0,r.jsx)(n.code,{children:"<head>"}),", used by search engines."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"image"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Cover or thumbnail image that will be used as the ",(0,r.jsx)(n.code,{children:'<meta property="og:image" content="..."/>'})," in the ",(0,r.jsx)(n.code,{children:"<head>"}),", enhancing link previews on social media and messaging platforms."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"slug"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"File path"}),(0,r.jsxs)(n.td,{children:["Allows to customize the document URL (",(0,r.jsx)(n.code,{children:"/<routeBasePath>/<slug>"}),"). Support multiple patterns: ",(0,r.jsx)(n.code,{children:"slug: my-doc"}),", ",(0,r.jsx)(n.code,{children:"slug: /my/path/myDoc"}),", ",(0,r.jsx)(n.code,{children:"slug: /"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tags"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"Tag[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["A list of strings or objects of two string fields ",(0,r.jsx)(n.code,{children:"label"})," and ",(0,r.jsx)(n.code,{children:"permalink"})," to tag to your docs. Strings can be a reference to keys of a ",(0,r.jsx)(n.a,{href:"#tags-file",children:"tags file"})," (usually ",(0,r.jsx)(n.code,{children:"tags.yml"}),")"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"draft"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Draft documents will only be available during development."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"unlisted"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:'Unlisted documents will be available in both development and production. They will be "hidden" in production, not indexed, excluded from sitemaps, and can only be accessed by users having a direct link.'})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"last_update"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"FrontMatterLastUpdate"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Allows overriding the last update author/date. Date can be any ",(0,r.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse",children:"parsable date string"}),"."]})]})]})]})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type FrontMatterLastUpdate = {date?: string; author?: string};\n\ntype Tag = string | {label: string; permalink: string};\n"})}),"\n",(0,r.jsx)(n.p,{children:"Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"---\nid: doc-markdown\ntitle: Docs Markdown Features\nhide_title: false\nhide_table_of_contents: false\nsidebar_label: Markdown\nsidebar_position: 3\npagination_label: Markdown features\ncustom_edit_url: https://github.com/facebook/docusaurus/edit/main/docs/api-doc-markdown.md\ndescription: How do I find you when I cannot solve this problem\nkeywords:\n - docs\n - docusaurus\ntags: [docusaurus]\nimage: https://i.imgur.com/mErPwqL.png\nslug: /myDoc\nlast_update:\n date: 1/1/2000\n author: custom author name\n---\n\n# Markdown Features\n\nMy Document Markdown content\n"})}),"\n","\n",(0,r.jsx)(a.ZP,{}),"\n",(0,r.jsx)(n.h2,{id:"i18n",children:"i18n"}),"\n",(0,r.jsxs)(n.p,{children:["Read the ",(0,r.jsx)(n.a,{href:"/docs/i18n/introduction",children:"i18n introduction"})," first."]}),"\n",(0,r.jsx)(n.h3,{id:"translation-files-location",children:"Translation files location"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Base path"}),": ",(0,r.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-docs"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Multi-instance path"}),": ",(0,r.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-docs-[pluginId]"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"JSON files"}),": extracted with ",(0,r.jsx)(n.a,{href:"/docs/cli#docusaurus-write-translations-sitedir",children:(0,r.jsx)(n.code,{children:"docusaurus write-translations"})})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Markdown files"}),": ",(0,r.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-docs/[versionName]"})]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"example-file-system-structure",children:"Example file-system structure"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"website/i18n/[locale]/docusaurus-plugin-content-docs\n\u2502\n\u2502 # translations for website/docs\n\u251C\u2500\u2500 current\n\u2502 \u251C\u2500\u2500 api\n\u2502 \u2502 \u2514\u2500\u2500 config.md\n\u2502 \u2514\u2500\u2500 getting-started.md\n\u251C\u2500\u2500 current.json\n\u2502\n\u2502 # translations for website/versioned_docs/version-1.0.0\n\u251C\u2500\u2500 version-1.0.0\n\u2502 \u251C\u2500\u2500 api\n\u2502 \u2502 \u2514\u2500\u2500 config.md\n\u2502 \u2514\u2500\u2500 getting-started.md\n\u2514\u2500\u2500 version-1.0.0.json\n"})})]})}function g(e={}){let{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},58636:function(e,n,t){t.d(n,{Z:()=>i});var s=t(85893);t(67294);var r=t(90496);function i(e){let{children:n,hidden:t,className:i}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.Z)("tabItem_pnkT",i),hidden:t,children:n})}},15398:function(e,n,t){t.d(n,{Z:()=>f});var s=t(85893),r=t(67294),i=t(90496),d=t(54947),l=t(3620),o=t(844),c=t(97486),a=t(32263),h=t(16971);function u(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)})?.filter(Boolean)??[]}function x(e){let{value:n,tabValues:t}=e;return t.some(e=>e.value===n)}var j=t(71607);function p(e){let{className:n,block:t,selectedValue:r,selectValue:l,tabValues:o}=e,c=[],{blockElementScrollPositionUntilNextRender:a}=(0,d.o5)(),h=e=>{let n=e.currentTarget,t=o[c.indexOf(n)].value;t!==r&&(a(n),l(t))},u=e=>{let n=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{let t=c.indexOf(e.currentTarget)+1;n=c[t]??c[0];break}case"ArrowLeft":{let t=c.indexOf(e.currentTarget)-1;n=c[t]??c[c.length-1]}}n?.focus()};return(0,s.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":t},n),children:o.map(e=>{let{value:n,label:t,attributes:d}=e;return(0,s.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>{c.push(e)},onKeyDown:u,onClick:h,...d,className:(0,i.Z)("tabs__item","tabItem_AQgk",d?.className,{"tabs__item--active":r===n}),children:t??n},n)})})}function g(e){let{lazy:n,children:t,selectedValue:d}=e,l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){let e=l.find(e=>e.props.value===d);return e?(0,r.cloneElement)(e,{className:(0,i.Z)("margin-top--md",e.props.className)}):null}return(0,s.jsx)("div",{className:"margin-top--md",children:l.map((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==d}))})}function m(e){let n=function(e){let{defaultValue:n,queryString:t=!1,groupId:s}=e,i=function(e){let{values:n,children:t}=e;return(0,r.useMemo)(()=>{let e=n??u(t).map(e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}),s=(0,a.lx)(e,(e,n)=>e.value===n.value);if(s.length>0)throw Error(`Docusaurus error: Duplicate values "${s.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`);return e},[n,t])}(e),[d,j]=(0,r.useState)(()=>(function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(n){if(!x({value:n,tabValues:t}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let s=t.find(e=>e.default)??t[0];if(!s)throw Error("Unexpected error: 0 tabValues");return s.value})({defaultValue:n,tabValues:i})),[p,g]=function(e){let{queryString:n=!1,groupId:t}=e,s=(0,l.k6)(),i=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,c._X)(i),(0,r.useCallback)(e=>{if(!i)return;let n=new URLSearchParams(s.location.search);n.set(i,e),s.replace({...s.location,search:n.toString()})},[i,s])]}({queryString:t,groupId:s}),[m,f]=function(e){let{groupId:n}=e,t=n?`docusaurus.tab.${n}`:null,[s,i]=(0,h.Nk)(t);return[s,(0,r.useCallback)(e=>{t&&i.set(e)},[t,i])]}({groupId:s}),b=(()=>{let e=p??m;return x({value:e,tabValues:i})?e:null})();return(0,o.Z)(()=>{b&&j(b)},[b]),{selectedValue:d,selectValue:(0,r.useCallback)(e=>{if(!x({value:e,tabValues:i}))throw Error(`Can't select invalid tab value=${e}`);j(e),g(e),f(e)},[g,f,i]),tabValues:i}}(e);return(0,s.jsxs)("div",{className:(0,i.Z)("tabs-container","tabList_Qoir"),children:[(0,s.jsx)(p,{...n,...e}),(0,s.jsx)(g,{...n,...e})]})}function f(e){let n=(0,j.Z)();return(0,s.jsx)(m,{...e,children:u(e.children)},String(n))}},56497:function(e,n,t){t.d(n,{Z:()=>i});var s=t(85893);t(67294);var r=t(71607);function i(e){let{children:n,fallback:t}=e;return(0,r.Z)()?(0,s.jsx)(s.Fragment,{children:n?.()}):t??null}},32240:function(e,n,t){t.d(n,{Z:()=>o});var s=t(85893),r=t(67294),i=t(96700),d=t(3620);let l=r.forwardRef(function(e,n){let{name:t,children:l}=e,o=function(e){let n=e;for(;(0,r.isValidElement)(n);)[n]=r.Children.toArray(n.props.children);if("string"!=typeof n)throw Error(`Could not extract APITable row name from JSX tree:
|
|
${JSON.stringify(e,null,2)}`);return n}(l),c=t?`${t}-${o}`:o,a=`#${c}`,h=(0,d.k6)();return(0,i.Z)().collectAnchor(c),(0,s.jsx)("tr",{id:c,tabIndex:0,ref:h.location.hash===a?n:void 0,onClick:e=>{let n="TD"===e.target.tagName.toUpperCase(),t=!!window.getSelection()?.toString();n&&!t&&h.push(a)},onKeyDown:e=>{"Enter"===e.key&&h.push(a)},children:l.props.children})});function o(e){let{children:n,name:t}=e;if("table"!==n.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");let[i,d]=r.Children.toArray(n.props.children),o=(0,r.useRef)(null);(0,r.useEffect)(()=>{o.current?.focus()},[o]);let c=r.Children.map(d.props.children,e=>(0,s.jsx)(l,{name:t,ref:o,children:e}));return(0,s.jsxs)("table",{className:"apiTable_e8hp",children:[i,(0,s.jsx)("tbody",{children:c})]})}},66359:function(e,n,t){t.d(n,{Z:()=>h});var s=t(85893);t(67294);var r=t(35363),i=t(90158),d=t(77827),l=t(15398),o=t(58636),c=t(27817);let a=void 0;function h(e){let{code:n,pluginName:t,presetOptionName:h}=e,u=(0,i.zu)(a).path;return(0,s.jsxs)(l.Z,{groupId:"api-config-ex",children:[(0,s.jsxs)(o.Z,{value:"preset",label:(0,d.I)({message:"Preset options"}),children:[(0,s.jsx)("p",{children:(0,s.jsx)(d.Z,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,s.jsx)(r.Z,{to:`${u}/using-plugins#docusauruspreset-classic`,children:(0,s.jsx)(d.Z,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,s.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = {
|
|
presets: [
|
|
[
|
|
'@docusaurus/preset-classic',
|
|
{
|
|
// highlight-start
|
|
${h}: ${n.replace(/\n/g,"\n ")},
|
|
// highlight-end
|
|
},
|
|
],
|
|
],
|
|
};`})]}),(0,s.jsxs)(o.Z,{value:"plugin",label:(0,d.I)({message:"Plugin options"}),children:[(0,s.jsx)("p",{children:(0,s.jsx)(d.Z,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,s.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = {
|
|
plugins: [
|
|
[
|
|
'${t}',
|
|
// highlight-start
|
|
${n.replace(/\n/g,"\n ")},
|
|
// highlight-end
|
|
],
|
|
],
|
|
};`})]})]})}},27817:function(e,n,t){t.d(n,{Z:()=>ep});var s={};t.r(s),t.d(s,{ButtonExample:()=>eh});var r=t(85893),i=t(67294),d=t(71607),l=t(90496),o=t(45245),c=t(26378);function a(){let{prism:e}=(0,c.L)(),{colorMode:n}=(0,o.I)(),t=e.theme,s=e.darkTheme||t;return"dark"===n?s:t}var h=t(55951),u=t(6324),x=t.n(u),j=t(50923);let p=/title=(?<quote>["'])(?<title>.*?)\1/,g=/\{(?<range>[\d,-]+)\}/,m={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},f={...m,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},b=Object.keys(m);function v(e,n){let t=e.map(e=>{let{start:t,end:s}=f[e];return`(?:${t}\\s*(${n.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${s})`}).join("|");return RegExp(`^\\s*(?:${t})\\s*$`)}let y=(0,i.createContext)(null);function w(e){let{metadata:n,wordWrap:t,children:s}=e,d=(0,i.useMemo)(()=>({metadata:n,wordWrap:t}),[n,t]);return(0,r.jsx)(y.Provider,{value:d,children:s})}function k(){let e=(0,i.useContext)(y);if(null===e)throw new j.i6("CodeBlockContextProvider");return e}function N(e){let{as:n,...t}=e,s=function(e){let n={color:"--prism-color",backgroundColor:"--prism-background-color"},t={};return Object.entries(e.plain).forEach(e=>{let[s,r]=e,i=n[s];i&&"string"==typeof r&&(t[i]=r)}),t}(a());return(0,r.jsx)(n,{...t,style:s,className:(0,l.Z)(t.className,"codeBlockContainer_jDV4",h.k.common.codeBlock)})}let C={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function T(e){let{children:n,className:t}=e;return(0,r.jsx)(N,{as:"pre",tabIndex:0,className:(0,l.Z)(C.codeBlockStandalone,"thin-scrollbar",t),children:(0,r.jsx)("code",{className:C.codeBlockLines,children:n})})}let P={attributes:!0,characterData:!0,childList:!0,subtree:!0};function I(e){let{children:n}=e;return n}var _=t(7316);function L(e){let{line:n,token:t,...s}=e;return(0,r.jsx)("span",{...s})}let D={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function B(e){let{line:n,classNames:t,showLineNumbers:s,getLineProps:i,getTokenProps:d}=e,o=function(e){let n=1===e.length&&"\n"===e[0].content?e[0]:void 0;return n?[{...n,content:""}]:e}(n),c=i({line:o,className:(0,l.Z)(t,s&&D.codeLine)}),a=o.map((e,n)=>{let t=d({token:e});return(0,r.jsx)(L,{...t,line:o,token:e,children:t.children},n)});return(0,r.jsxs)("span",{...c,children:[s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:D.codeLineNumber}),(0,r.jsx)("span",{className:D.codeLineContent,children:a})]}):a,(0,r.jsx)("br",{})]})}let E=i.forwardRef((e,n)=>(0,r.jsx)("pre",{ref:n,tabIndex:0,...e,className:(0,l.Z)(e.className,C.codeBlock,"thin-scrollbar")}));function S(e){let{metadata:n}=k();return(0,r.jsx)("code",{...e,className:(0,l.Z)(e.className,C.codeBlockLines,void 0!==n.lineNumbersStart&&C.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===n.lineNumbersStart?void 0:`line-count ${n.lineNumbersStart-1}`}})}function U(e){let{className:n}=e,{metadata:t,wordWrap:s}=k(),i=a(),{code:d,language:o,lineNumbersStart:c,lineClassNames:h}=t;return(0,r.jsx)(_.y$,{theme:i,code:d,language:o,children:e=>{let{className:t,style:i,tokens:d,getLineProps:o,getTokenProps:a}=e;return(0,r.jsx)(E,{ref:s.codeBlockRef,className:(0,l.Z)(n,t),style:i,children:(0,r.jsx)(S,{children:d.map((e,n)=>(0,r.jsx)(B,{line:e,getLineProps:o,getTokenProps:a,classNames:h[n],showLineNumbers:void 0!==c},n))})})}})}var R=t(56497),Z=t(44771),M=t(77827);function A(e){let{className:n,...t}=e;return(0,r.jsx)("button",{type:"button",...t,className:(0,l.Z)("clean-btn",n)})}function V(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function F(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let $={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function W(e){let{className:n}=e,{copyCode:t,isCopied:s}=function(){let{metadata:{code:e}}=k(),[n,t]=(0,i.useState)(!1),s=(0,i.useRef)(void 0),r=(0,i.useCallback)(()=>{(0,Z.Z)(e),t(!0),s.current=window.setTimeout(()=>{t(!1)},1e3)},[e]);return(0,i.useEffect)(()=>()=>window.clearTimeout(s.current),[]),{copyCode:r,isCopied:n}}();return(0,r.jsx)(A,{"aria-label":s?(0,M.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,M.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,M.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,l.Z)(n,$.copyButton,s&&$.copyButtonCopied),onClick:t,children:(0,r.jsxs)("span",{className:$.copyButtonIcons,"aria-hidden":"true",children:[(0,r.jsx)(V,{className:$.copyButtonIcon}),(0,r.jsx)(F,{className:$.copyButtonSuccessIcon})]})})}function O(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let G={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function z(e){let{className:n}=e,{wordWrap:t}=k();if(!(t.isEnabled||t.isCodeScrollable))return!1;let s=(0,M.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,r.jsx)(A,{onClick:()=>t.toggle(),className:(0,l.Z)(n,t.isEnabled&&G.wordWrapButtonEnabled),"aria-label":s,title:s,children:(0,r.jsx)(O,{className:G.wordWrapButtonIcon,"aria-hidden":"true"})})}function q(e){let{className:n}=e;return(0,r.jsx)(R.Z,{children:()=>(0,r.jsxs)("div",{className:(0,l.Z)(n,"buttonGroup_KXnS"),children:[(0,r.jsx)(z,{}),(0,r.jsx)(W,{})]})})}let H={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function X(e){let{className:n}=e,{metadata:t}=k();return(0,r.jsxs)(N,{as:"div",className:(0,l.Z)(n,t.className),children:[t.title&&(0,r.jsx)("div",{className:H.codeBlockTitle,children:(0,r.jsx)(I,{children:t.title})}),(0,r.jsxs)("div",{className:H.codeBlockContent,children:[(0,r.jsx)(U,{}),(0,r.jsx)(q,{})]})]})}function Y(e){let n=function(e){let{prism:n}=(0,c.L)();return function(e){var n,t,s;let r=(t=(n={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let n=e.split(" ").find(e=>e.startsWith("language-"));return n?.replace(/language-/,"")}(n.className)??n.defaultLanguage,t?.toLowerCase()??"text"),{lineClassNames:i,code:d}=function(e,n){let t=e.replace(/\r?\n$/,"");return function(e,n){let{metastring:t,magicComments:s}=n;if(t&&g.test(t)){let n=t.match(g).groups.range;if(0===s.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${t}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let r=s[0].className;return{lineClassNames:Object.fromEntries(x()(n).filter(e=>e>0).map(e=>[e-1,[r]])),code:e}}return null}(t,{...n})??function(e,n){let{language:t,magicComments:s}=n;if(void 0===t)return{lineClassNames:{},code:e};let r=function(e,n){switch(e){case"js":case"javascript":case"ts":case"typescript":return v(["js","jsBlock"],n);case"jsx":case"tsx":return v(["js","jsBlock","jsx"],n);case"html":return v(["js","jsBlock","html"],n);case"python":case"py":case"bash":return v(["bash"],n);case"markdown":case"md":return v(["html","jsx","bash"],n);case"tex":case"latex":case"matlab":return v(["tex"],n);case"lua":case"haskell":return v(["lua"],n);case"sql":return v(["lua","jsBlock"],n);case"wasm":return v(["wasm"],n);case"vb":case"vba":case"visual-basic":return v(["vb","rem"],n);case"vbnet":return v(["vbnet","rem"],n);case"batch":return v(["rem"],n);case"basic":return v(["rem","f90"],n);case"fsharp":return v(["js","ml"],n);case"ocaml":case"sml":return v(["ml"],n);case"fortran":return v(["f90"],n);case"cobol":return v(["cobol"],n);default:return v(b,n)}}(t,s),i=e.split(/\r?\n/),d=Object.fromEntries(s.map(e=>[e.className,{start:0,range:""}])),l=Object.fromEntries(s.filter(e=>e.line).map(e=>{let{className:n,line:t}=e;return[t,n]})),o=Object.fromEntries(s.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.start,n]})),c=Object.fromEntries(s.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.end,n]}));for(let e=0;e<i.length;){let n=i[e].match(r);if(!n){e+=1;continue}let t=n.slice(1).find(e=>void 0!==e);l[t]?d[l[t]].range+=`${e},`:o[t]?d[o[t]].start=e:c[t]&&(d[c[t]].range+=`${d[c[t]].start}-${e-1},`),i.splice(e,1)}let a={};return Object.entries(d).forEach(e=>{let[n,{range:t}]=e;x()(t).forEach(e=>{a[e]??=[],a[e].push(n)})}),{code:i.join("\n"),lineClassNames:a}}(t,{...n})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:r}),o=function(e){let{className:n,language:t}=e;return(0,l.Z)(n,t&&!n?.includes(`language-${t}`)&&`language-${t}`)}({className:e.className,language:r}),c=(s=e.metastring,(s?.match(p)?.groups.title??"")||e.title),a=function(e){let{showLineNumbers:n,metastring:t}=e;if("boolean"==typeof n)return n?1:void 0;if("number"==typeof n)return n;let s=t?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(s)return s.startsWith("showLineNumbers=")?parseInt(s.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:d,className:o,language:r,title:c,lineNumbersStart:a,lineClassNames:i}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:n.magicComments,defaultLanguage:n.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),t=function(){let[e,n]=(0,i.useState)(!1),[t,s]=(0,i.useState)(!1),r=(0,i.useRef)(null),d=(0,i.useCallback)(()=>{let t=r.current.querySelector("code");e?t.removeAttribute("style"):(t.style.whiteSpace="pre-wrap",t.style.overflowWrap="anywhere"),n(e=>!e)},[r,e]),l=(0,i.useCallback)(()=>{let{scrollWidth:e,clientWidth:n}=r.current;s(e>n||r.current.querySelector("code").hasAttribute("style"))},[r]),[o,c]=(0,i.useState)(),a=(0,i.useCallback)(()=>{c(r.current?.closest("[role=tabpanel][hidden]"))},[r,c]);return(0,i.useEffect)(()=>{a()},[a]),!function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:P,s=(0,j.zX)(n),r=(0,j.Ql)(t);(0,i.useEffect)(()=>{let n=new MutationObserver(s);return e&&n.observe(e,r),()=>n.disconnect()},[e,s,r])}(o,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(l(),a())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,i.useEffect)(()=>{l()},[e,l]),(0,i.useEffect)(()=>(window.addEventListener("resize",l,{passive:!0}),()=>{window.removeEventListener("resize",l)}),[l]),{codeBlockRef:r,isEnabled:e,isCodeScrollable:t,toggle:d}}();return(0,r.jsx)(w,{metadata:n,wordWrap:t,children:(0,r.jsx)(X,{})})}function K(e){let{children:n,...t}=e,s=(0,d.Z)(),l=i.Children.toArray(n).some(e=>(0,i.isValidElement)(e))?n:Array.isArray(n)?n.join(""):n;return(0,r.jsx)("string"==typeof l?Y:T,{...t,children:l},String(s))}var J=t(10075);let Q=e=>`${e};`;function ee(e){let{code:n,children:t,...s}=e,i=a(),d=s.metastring?.includes("noInline")??!1;return(0,r.jsx)(J.nu,{noInline:d,theme:i,...s,code:n?.replace(/\n$/,""),transformCode:s.transformCode??Q,children:t})}function en(e){let{children:n}=e;return(0,r.jsx)("div",{className:"playgroundContainer_TDLX",children:n})}var et=t(85108),es=t(67490);function er(e){let{children:n}=e;return(0,r.jsx)("div",{className:(0,l.Z)("playgroundHeader_h_Hu"),children:n})}function ei(){return(0,r.jsx)("div",{children:"Loading..."})}function ed(){return(0,r.jsx)(R.Z,{fallback:(0,r.jsx)(ei,{}),children:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(es.Z,{fallback:e=>(0,r.jsx)(et.Ac,{...e}),children:(0,r.jsx)(J.i5,{})}),(0,r.jsx)(J.IF,{})]})})}function el(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er,{children:(0,r.jsx)(M.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,r.jsx)("div",{className:"playgroundPreview_u2xE",children:(0,r.jsx)(ed,{})})]})}function eo(){let e=(0,d.Z)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er,{children:(0,r.jsx)(M.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,r.jsx)(J.uz,{className:"playgroundEditor_uqZ4"},String(e))]})}function ec(){let{playgroundPosition:e}=(0,c.L)().liveCodeBlock;return(0,r.jsx)(r.Fragment,{children:"top"===e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(el,{}),(0,r.jsx)(eo,{})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eo,{}),(0,r.jsx)(el,{})]})})}function ea(e){let{children:n,transformCode:t,...s}=e;return(0,r.jsx)(en,{children:(0,r.jsx)(ee,{code:n,...s,children:(0,r.jsx)(ec,{})})})}function eh(e){return(0,r.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let eu={React:i,...i,...s};function ex(e){return(0,r.jsx)(ea,{scope:eu,...e})}function ej(e){return e.live?(0,r.jsx)(ex,{...e}):(0,r.jsx)(K,{...e})}function ep(e){return(0,r.jsx)(ej,{...e})}}}]); |