📦 plugin-content-docs
Provides the Docs functionality and is the default docs plugin for Docusaurus.
설치
- npm
- Yarn
- pnpm
- Bun
npm install --save @docusaurus/plugin-content-docs
yarn add @docusaurus/plugin-content-docs
pnpm add @docusaurus/plugin-content-docs
bun add @docusaurus/plugin-content-docs
팁
If you use the preset @docusaurus/preset-classic, you don't need to install this plugin as a dependency.
You can configure this plugin through the preset options.
설정
설정할 수 있는 필드
| 옵션명 | 타입 | 기본값 | 설명 |
|---|---|---|---|
path | string | 'docs' | 사이트 디렉토리에 상대적인 파일 시스템의 문서 콘텐츠 디렉토리 경로입니다. |
editUrl | string | EditUrlFunction | undefined | 사이트를 편집하기 위한 Base URL입니다. The final URL is computed by editUrl + relativeDocPath. 옵션 사용 시 각 파일에 대한 세밀한 제어를 할 수 있습니다. 해당 필드를 설정하지 않으면 편집 링크가 비활성화됩니다. |
editLocalizedFiles | boolean | false | 편집 URL은 현지화되지 않은 원본 파일 대신 현지화된 파일을 대상으로 합니다. Ignored when editUrl is a function. |
editCurrentVersion | boolean | false | 편집 URL은 항상 이전 버전 대신 현재 버전 문서를 대상으로 합니다. Ignored when editUrl is a function. |
routeBasePath | string | 'docs' | 사이트 문서 섹션에 대한 URL 라우트 DO NOT include a trailing slash. Use / for shipping docs without base path. |
tagsBasePath | string | 'tags' | 사이트 태그 목록 페이지에 대한 URL 라우트 It is prepended to the routeBasePath. |
include | string[] | ['**/*.{md,mdx}'] | 콘텐츠 경로를 기준으로 빌드할 마크다운 파일과 일치하는 glob 패턴 배열입니다. |
exclude | string[] | See example configuration | 제외할 마크다운 파일과 일치하는 glob 패턴 배열입니다. Serves as refinement based on the include option. |
sidebarPath | false | string | undefined | Path to a sidebars configuration file, loaded in a Node.js context. Use false to disable sidebars, or undefined to create a fully autogenerated sidebar. |
sidebarCollapsible | boolean | true | 기본적으로 사이드바 카테고리를 접을 수 있는지 여부를 설정합니다. See also Collapsible categories |
sidebarCollapsed | boolean | true | 기본적으로 사이드바 카테고리를 접을지 여부를 설정합니다. See also Expanded categories by default |
sidebarItemsGenerator | SidebarGenerator | Omitted | Function used to replace the sidebar items of type 'autogenerated' with real sidebar items (docs, categories, links...). See also Customize the sidebar items generator |
numberPrefixParser | boolean | PrefixParser | Omitted | 파일명에서 숫자 접두사를 추출하는 사용자 지정 구문 분석 방식을 설정합니다. Use false to disable this behavior and leave the docs untouched, and true to use the default parser. See also Using number prefixes |
docsRootComponent | string | '@theme/DocsRoot' | 모든 문서 플러그인 페이지(모든 버전 포함)의 상위 컴포넌트입니다. 문서 페이지와 버전 사이를 탐색할 때 마운트된 상태로 유지됩니다. |
docVersionRootComponent | string | '@theme/DocVersionLayout' | 개별 버전의 모든 문서 페이지(사이드바가 있는 문서 페이지, 태그 페이지)의 상위 컴포넌트입니다. 특정 버전의 페이지 사이를 탐색할 때 마운트된 상태로 유지됩니다. |
docRootComponent | string | '@theme/DocRoot' | 사이드바가 있는 모든 문서 페이지(일반 문서 페이지, 카테고리 생성 색인 페이지)의 상위 컴포넌트입니다. 각 페이지 사이를 탐색할 때 마운트된 상태로 유지됩니다. |
docItemComponent | string | '@theme/DocItem' | 목차, 페이지 영역 등 기본 문서 컨테이너 |
docTagsListComponent | string | '@theme/DocTagsListPage' | 태그 목록 페이지의 루트 컴포넌트 |
docTagDocListComponent | string | '@theme/DocTagDocListPage' | "태그 X를 포함한 문서" 페이지의 루트 컴포넌트 |
docCategoryGeneratedIndexComponent | string | '@theme/DocCategoryGeneratedIndexPage' | 생성된 카테고리 인덱스 페이지의 루트 컴포넌트 |
remarkPlugins | any[] | [] | MDX에 전달된 Remark 플러그인 |
rehypePlugins | any[] | [] | MDX에 전달된 Rehype 플러그인 |
rehypePlugins | any[] | [] | Recma plugins passed to MDX. |
beforeDefaultRemarkPlugins | any[] | [] | 기본 도큐사우루스 Remark 플러그인보다 먼저 MDX에 전달된 사용자 지정 Remark 플러그인 |
beforeDefaultRehypePlugins | any[] | [] | 기본 도큐사우루스 Rehype 플러그인보다 먼저 MDX에 전달된 사용자 지정 Rehype 플러그인 |
showLastUpdateAuthor | boolean | false | 문서를 마지막으로 업데이트한 작성자를 표시할지 여부 |
showLastUpdateTime | boolean | false | 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 actions/checkout, usefetch-depth: 0. |
breadcrumbs | boolean | true | 문서 페이지에서 이동 경로를 활성화 또는 비활성화 |
disableVersioning | boolean | false | 여러 버전이 있더라도 명시적으로 버전 관리를 비활성화합니다. 이렇게 하면 사이트에 현재 버전만 포함됩니다. Will error if includeCurrentVersion: false and disableVersioning: true. |
includeCurrentVersion | boolean | true | 문서의 현재 버전을 포함 |
lastVersion | string | First version in versions.json | 문서 메뉴바 아이템에 대해 우선적으로 탐색되고 기본적으로 표시되는 버전 |
onlyIncludeVersions | string[] | 사용할 수 있는 모든 버전 | 사용할 수 있는 모든 버전의 하위 집합만 포함 |
versions | VersionsConfig | {} | 각 버전의 속성을 독립적으로 사용자 지정합니다. |
tags | string | false | null | undefined | tags.yml | Path to a YAML file listing pre-defined tags. Relative to the docs version content directories. |
onInlineTags | 'ignore' | 'log' | 'warn' | 'throw' | warn | The plugin behavior when docs contain inline tags (not appearing in the list of pre-defined tags, usually docs/tags.yml). |
타입
EditUrlFunction
type EditUrlFunction = (params: {
version: string;
versionDocsDirPath: string;
docPath: string;
permalink: string;
locale: string;
}) => string | undefined;
PrefixParser
type PrefixParser = (filename: string) => {
filename: string;
numberPrefix?: number;
};
SidebarGenerator
type SidebarGenerator = (generatorArgs: {
/** The sidebar item with type "autogenerated" to be transformed. */
item: {type: 'autogenerated'; dirName