๋ณธ๋ฌธ์œผ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ
๋ฒ„์ „: 2.2.0

๐Ÿ“ฆ plugin-content-docs

๋ฌธ์„œ ๋งŒ๋“ค๊ธฐ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•˜๋Š” ๋„ํ์‚ฌ์šฐ๋ฃจ์Šค์˜ ๊ธฐ๋ณธ ๋ฌธ์„œ ํ”Œ๋Ÿฌ๊ทธ์ธ์ž…๋‹ˆ๋‹ค.

์„ค์น˜โ€‹

npm install --save @docusaurus/plugin-content-docs
ํŒ

@docusaurus/preset-classic์„ ์„ค์น˜ํ•œ ๊ฒฝ์šฐ์—๋Š” ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ๋”ฐ๋กœ ์„ค์น˜ํ•  ํ•„์š”๋Š” ์—†์Šต๋‹ˆ๋‹ค.

์—ฌ๋Ÿฌ๋ถ„์€ ํ”„๋ฆฌ์…‹ ์˜ต์…˜์„ ์‚ฌ์šฉํ•ด ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์„ค์ •โ€‹

์„ค์ •ํ•  ์ˆ˜ ์žˆ๋Š” ํ•„๋“œ

์˜ต์…˜๋ช…ํƒ€์ž…๊ธฐ๋ณธ๊ฐ’์„ค๋ช…
pathstring'docs'์‚ฌ์ดํŠธ ๋””๋ ‰ํ† ๋ฆฌ์— ์ƒ๋Œ€์ ์ธ ํŒŒ์ผ ์‹œ์Šคํ…œ์˜ ๋ฌธ์„œ ์ฝ˜ํ…์ธ  ๋””๋ ‰ํ† ๋ฆฌ ๊ฒฝ๋กœ์ž…๋‹ˆ๋‹ค.
editUrlstring | EditUrlFunctionundefined์‚ฌ์ดํŠธ๋ฅผ ํŽธ์ง‘ํ•˜๊ธฐ ์œ„ํ•œ Base URL์ž…๋‹ˆ๋‹ค. ์ตœ์ข… URL์€ editUrl + relativeDocPath ํ˜•ํƒœ๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค. ์˜ต์…˜ ์‚ฌ์šฉ ์‹œ ๊ฐ ํŒŒ์ผ์— ๋Œ€ํ•œ ์„ธ๋ฐ€ํ•œ ์ œ์–ด๋ฅผ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ํ•„๋“œ๋ฅผ ์„ค์ •ํ•˜์ง€ ์•Š์œผ๋ฉด ํŽธ์ง‘ ๋งํฌ๊ฐ€ ๋น„ํ™œ์„ฑํ™”๋ฉ๋‹ˆ๋‹ค.
editLocalizedFilesbooleanfalseํŽธ์ง‘ URL์€ ํ˜„์ง€ํ™”๋˜์ง€ ์•Š์€ ์›๋ณธ ํŒŒ์ผ ๋Œ€์‹  ํ˜„์ง€ํ™”๋œ ํŒŒ์ผ์„ ๋Œ€์ƒ์œผ๋กœ ํ•ฉ๋‹ˆ๋‹ค. editUrl์ด ํ•จ์ˆ˜์ธ ๊ฒฝ์šฐ์—๋Š” ๋ฌด์‹œํ•ฉ๋‹ˆ๋‹ค.
editCurrentVersionbooleanfalseํŽธ์ง‘ URL์€ ํ•ญ์ƒ ์ด์ „ ๋ฒ„์ „ ๋Œ€์‹  ํ˜„์žฌ ๋ฒ„์ „ ๋ฌธ์„œ๋ฅผ ๋Œ€์ƒ์œผ๋กœ ํ•ฉ๋‹ˆ๋‹ค. editUrl์ด ํ•จ์ˆ˜์ธ ๊ฒฝ์šฐ์—๋Š” ๋ฌด์‹œํ•ฉ๋‹ˆ๋‹ค.
routeBasePathstring'docs'์‚ฌ์ดํŠธ ๋ฌธ์„œ ์„น์…˜์— ๋Œ€ํ•œ URL ๋ผ์šฐํŠธ ํŠธ๋ ˆ์ผ๋ง ์Šฌ๋ž˜์‹œ๋ฅผ ํฌํ•จํ•˜์ง€ ๋งˆ์„ธ์š”. ๊ธฐ๋ณธ ๊ฒฝ๋กœ ์—†์ด ๋ฌธ์„œ๋ฅผ ์ฒ˜๋ฆฌํ•  ๋•Œ์— /๋ฅผ ์‚ฌ์šฉํ•˜์„ธ์š”.
tagsBasePathstring'tags'์‚ฌ์ดํŠธ ํƒœ๊ทธ ๋ชฉ๋ก ํŽ˜์ด์ง€์— ๋Œ€ํ•œ URL ๋ผ์šฐํŠธ routeBasePath ์•ž์— ์ถ”๊ฐ€๋ฉ๋‹ˆ๋‹ค.
includestring[]['**/*.{md,mdx}']์ฝ˜ํ…์ธ  ๊ฒฝ๋กœ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋นŒ๋“œํ•  ๋งˆํฌ๋‹ค์šด ํŒŒ์ผ๊ณผ ์ผ์น˜ํ•˜๋Š” glob ํŒจํ„ด ๋ฐฐ์—ด์ž…๋‹ˆ๋‹ค.
excludestring[]์„ค์ • ์˜ˆ์‹œ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”์ œ์™ธํ•  ๋งˆํฌ๋‹ค์šด ํŒŒ์ผ๊ณผ ์ผ์น˜ํ•˜๋Š” glob ํŒจํ„ด ๋ฐฐ์—ด์ž…๋‹ˆ๋‹ค. include ์˜ต์…˜์„ ์ข€ ๋” ์„ธ๋ถ„ํ™”ํ•˜๋Š” ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค.
sidebarPathfalse | stringundefined์‚ฌ์ด๋“œ๋ฐ” ๊ตฌ์„ฑ ๊ฒฝ๋กœ์ž…๋‹ˆ๋‹ค. ์‚ฌ์ด๋“œ๋ฐ”๋ฅผ ๋น„ํ™œ์„ฑํ™”ํ•˜๋ ค๋ฉด false๋ฅผ ์„ค์ •ํ•˜๊ณ  ์™„์ „ํžˆ ์ž๋™์œผ๋กœ ์ƒ์„ฑ๋œ ์‚ฌ์ด๋“œ๋ฐ”๋ฅผ ๋งŒ๋“ค๋ ค๋ฉด undefined๋ฅผ ์„ค์ •ํ•˜์„ธ์š”.
sidebarCollapsiblebooleantrue๊ธฐ๋ณธ์ ์œผ๋กœ ์‚ฌ์ด๋“œ๋ฐ” ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ์ ‘์„ ์ˆ˜ ์žˆ๋Š”์ง€ ์—ฌ๋ถ€๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ ‘์„ ์ˆ˜ ์žˆ๋Š” ์นดํ…Œ๊ณ ๋ฆฌ ํ•ญ๋ชฉ์„ ์ฐธ์กฐํ•˜์„ธ์š”.
sidebarCollapsedbooleantrue๊ธฐ๋ณธ์ ์œผ๋กœ ์‚ฌ์ด๋“œ๋ฐ” ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ์ ‘์„์ง€ ์—ฌ๋ถ€๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋ณธ์ ์œผ๋กœ ํŽผ์ณ์ง„ ์นดํ…Œ๊ณ ๋ฆฌ ํ•ญ๋ชฉ์„ ์ฐธ์กฐํ•˜์„ธ์š”.
sidebarItemsGeneratorSidebarGenerator์„ค์ •ํ•˜์ง€ ์•Š์Œ'autogenerated' ํƒ€์ž…์˜ ์‚ฌ์ด๋“œ๋ฐ” ํ•ญ๋ชฉ์„ ์‹ค์ œ ์‚ฌ์ด๋“œ๋ฐ” ํ•ญ๋ชฉ(๋ฌธ์„œ, ์นดํ…Œ๊ณ ๋ฆฌ, ๋งํฌ ๋“ฑ)์œผ๋กœ ๊ต์ฒดํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋˜๋Š” ๊ธฐ๋Šฅ์ž…๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž ์ง€์ • ์‚ฌ์ด๋“œ๋ฐ” ์•„์ดํ…œ ์ƒ์„ฑ๊ธฐ ํ•ญ๋ชฉ์„ ์ฐธ์กฐํ•˜์„ธ์š”.
numberPrefixParserboolean | PrefixParser์„ค์ •ํ•˜์ง€ ์•Š์ŒํŒŒ์ผ๋ช…์—์„œ ์ˆซ์ž ์ ‘๋‘์‚ฌ๋ฅผ ์ถ”์ถœํ•˜๋Š” ์‚ฌ์šฉ์ž ์ง€์ • ๊ตฌ๋ฌธ ๋ถ„์„ ๋ฐฉ์‹์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ํ•ด๋‹น ๋™์ž‘์„ ๋น„ํ™œ์„ฑํ™”ํ•˜๊ณ  ๋ฌธ์„œ๋ฅผ ์œ ์ง€ํ•˜๋ ค๋ฉด false๋ฅผ ์„ ํƒํ•˜๊ณ  ๊ธฐ๋ณธ ๊ตฌ๋ฌธ ๋ถ„์„์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด true๋ฅผ ์„ ํƒํ•˜์„ธ์š”. ์ˆซ์ž ์ ‘๋‘์‚ฌ ์‚ฌ์šฉํ•˜๊ธฐ ํ•ญ๋ชฉ์„ ์ฐธ์กฐํ•˜์„ธ์š”.
docLayoutComponentstring'@theme/DocPage'๊ฐ ๋ฌธ์„œ ํŽ˜์ด์ง€์˜ ๋ฃจํŠธ ๋ ˆ์ด์•„์›ƒ ์ปดํฌ๋„ŒํŠธ์ž…๋‹ˆ๋‹ค. ๋ฒ„์ „ ๋ฐ์ดํ„ฐ ์ปจํ…์ŠคํŠธ๋ฅผ ์ œ๊ณตํ•˜๋ฉฐ ๋ฌธ์„œ ์ „ํ™˜ ์‹œ ๋งˆ์šดํŠธ ํ•ด์ œ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
docItemComponentstring'@theme/DocItem'๋ชฉ์ฐจ, ํŽ˜์ด์ง€ ์˜์—ญ ๋“ฑ ๊ธฐ๋ณธ ๋ฌธ์„œ ์ปจํ…Œ์ด๋„ˆ
docTagsListComponentstring'@theme/DocTagsListPage'ํƒœ๊ทธ ๋ชฉ๋ก ํŽ˜์ด์ง€์˜ ๋ฃจํŠธ ์ปดํฌ๋„ŒํŠธ
docTagDocListComponentstring'@theme/DocTagDocListPage'"ํƒœ๊ทธ X๋ฅผ ํฌํ•จํ•œ ๋ฌธ์„œ" ํŽ˜์ด์ง€์˜ ๋ฃจํŠธ ์ปดํฌ๋„ŒํŠธ
docCategoryGeneratedIndexComponentstring'@theme/DocCategoryGeneratedIndexPage'์ƒ์„ฑ๋œ ์นดํ…Œ๊ณ ๋ฆฌ ์ธ๋ฑ์Šค ํŽ˜์ด์ง€์˜ ๋ฃจํŠธ ์ปดํฌ๋„ŒํŠธ
remarkPluginsany[][]MDX์— ์ „๋‹ฌ๋œ Remark ํ”Œ๋Ÿฌ๊ทธ์ธ
rehypePluginsany[][]MDX์— ์ „๋‹ฌ๋œ Rehype ํ”Œ๋Ÿฌ๊ทธ์ธ
beforeDefaultRemarkPluginsany[][]๊ธฐ๋ณธ ๋„ํ์‚ฌ์šฐ๋ฃจ์Šค Remark ํ”Œ๋Ÿฌ๊ทธ์ธ๋ณด๋‹ค ๋จผ์ € MDX์— ์ „๋‹ฌ๋œ ์‚ฌ์šฉ์ž ์ง€์ • Remark ํ”Œ๋Ÿฌ๊ทธ์ธ
beforeDefaultRehypePluginsany[][]๊ธฐ๋ณธ ๋„ํ์‚ฌ์šฐ๋ฃจ์Šค Rehype ํ”Œ๋Ÿฌ๊ทธ์ธ๋ณด๋‹ค ๋จผ์ € MDX์— ์ „๋‹ฌ๋œ ์‚ฌ์šฉ์ž ์ง€์ • Rehype ํ”Œ๋Ÿฌ๊ทธ์ธ
showLastUpdateAuthorbooleanfalse๋ฌธ์„œ๋ฅผ ๋งˆ์ง€๋ง‰์œผ๋กœ ์—…๋ฐ์ดํŠธํ•œ ์ž‘์„ฑ์ž๋ฅผ ํ‘œ์‹œํ• ์ง€ ์—ฌ๋ถ€
showLastUpdateTimebooleanfalse๋ฌธ์„œ๋ฅผ ๋งˆ์ง€๋ง‰์œผ๋กœ ์—…๋ฐ์ดํŠธํ•œ ๋‚ ์งœ๋ฅผ ํ‘œ์‹œํ• ์ง€ ์—ฌ๋ถ€
disableVersioningbooleanfalse์—ฌ๋Ÿฌ ๋ฒ„์ „์ด ์žˆ๋”๋ผ๋„ ๋ช…์‹œ์ ์œผ๋กœ ๋ฒ„์ „ ๊ด€๋ฆฌ๋ฅผ ๋น„ํ™œ์„ฑํ™”ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ์‚ฌ์ดํŠธ์— ํ˜„์žฌ ๋ฒ„์ „๋งŒ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค. includeCurrentVersion: false์ด๋‚˜ disableVersioning: true ์ธ ๊ฒฝ์šฐ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.
includeCurrentVersionbooleantrue๋ฌธ์„œ์˜ ํ˜„์žฌ ๋ฒ„์ „์„ ํฌํ•จ
lastVersionstringversions.json ํŒŒ์ผ์—์„œ ์ฒซ ๋ฒˆ์งธ ๋ฒ„์ „๋ฌธ์„œ ๋ฉ”๋‰ด๋ฐ” ์•„์ดํ…œ์— ๋Œ€ํ•ด ์šฐ์„ ์ ์œผ๋กœ ํƒ์ƒ‰๋˜๊ณ  ๊ธฐ๋ณธ์ ์œผ๋กœ ํ‘œ์‹œ๋˜๋Š” ๋ฒ„์ „
onlyIncludeVersionsstring[]์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๋ชจ๋“  ๋ฒ„์ „์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๋ชจ๋“  ๋ฒ„์ „์˜ ํ•˜์œ„ ์ง‘ํ•ฉ๋งŒ ํฌํ•จ
versionsVersionsConfig{}๊ฐ ๋ฒ„์ „์˜ ์†์„ฑ์„ ๋…๋ฆฝ์ ์œผ๋กœ ์‚ฌ์šฉ์ž ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

ํƒ€์ž…โ€‹

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: {
/** ๋ณ€ํ™˜ํ•  "์ž๋™ ์ƒ์„ฑ" ํƒ€์ž…์˜ ์‚ฌ์ด๋“œ๋ฐ” ํ•ญ๋ชฉ์ž…๋‹ˆ๋‹ค. */
item: {type: 'autogenerated'; dirName: string};
/** ์‚ฌ์ด๋“œ๋ฐ”๊ฐ€ ์†ํ•œ ๋ฒ„์ „์— ํ•„์š”ํ•œ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ์ž…๋‹ˆ๋‹ค. */
version: {contentPath: string; versionName: string};
/** ํ•ด๋‹น ๋ฒ„์ „์˜ ๋ชจ๋“  ๋ฌธ์„œ(ํ•„ํ„ฐ๋งํ•˜์ง€ ์•Š์€). */
docs: {
id: string;
title: string;
frontMatter: DocFrontMatter & Record<string, unknown>;
source: string;
sourceDirName: string;
sidebarPosition?: number | undefined;
}[];
/** ํ”Œ๋Ÿฌ๊ทธ์ธ์—์„œ ์„ค์ •ํ•œ ์ˆซ์ž ์ ‘๋‘์‚ฌ ๊ตฌ๋ฌธ๋ถ„์„๊ธฐ์ž…๋‹ˆ๋‹ค. */
numberPrefixParser: PrefixParser;
/** ์žฌ์ •์˜ํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋ณธ ์นดํ…Œ๊ณ ๋ฆฌ ์ธ๋ฑ์Šค ์ผ์น˜์ž์ž…๋‹ˆ๋‹ค. */
isCategoryIndex: CategoryIndexMatcher;
/**
* key๋Š” ๋ฌธ์„œ ์ฝ˜ํ…์ธ  ๋””๋ ‰ํ† ๋ฆฌ์— ๋Œ€ํ•œ ์ƒ๋Œ€ ๊ฒฝ๋กœ์ด๊ณ 
* value๋Š” ์นดํ…Œ๊ณ ๋ฆฌ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ํŒŒ์ผ์˜ ์ฝ˜ํ…์ธ ์ž…๋‹ˆ๋‹ค.
*/
categoriesMetadata: {[filePath: string]: CategoryMetadata};
/**
* ๋„ํ์‚ฌ์šฐ๋ฃจ์Šค์˜ ๊ธฐ๋ณธ ์‚ฌ์ด๋“œ๋ฐ” ์ƒ์„ฑ ๋กœ์ง์„
* ์žฌ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜ ํ–ฅ์ƒ์‹œํ‚ค๋Š” ๋ฐ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.
*/
defaultSidebarItemsGenerator: SidebarGenerator;
// ์‚ฌ์ด๋“œ๋ฐ” ํ•ญ๋ชฉ์˜ ๋ฐฐ์—ด์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๋‹จ์ถ•ํ˜•์„ ์ œ์™ธํ•˜๋ฉด
// sidebars.js์—์„œ ์„ ์–ธํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. https://docusaurus.io/docs/sidebar/items ํ•ญ๋ชฉ์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.
}) => Promise<SidebarItem[]>;

type CategoryIndexMatcher = (param: {
/** ํ™•์žฅ์ž ์—†๋Š” ํŒŒ์ผ๋ช… */
fileName: string;
/**
* ๊ฐ€์žฅ ๋‚ฎ์€ ์ˆ˜์ค€์—์„œ ๋†’์€ ์ˆ˜์ค€์œผ๋กœ ์ •๋ ฌํ•œ ๋””๋ ‰ํ† ๋ฆฌ ๋ชฉ๋ก์ž…๋‹ˆ๋‹ค.
* ๋””๋ ‰ํ† ๋ฆฌ ์ด๋ฆ„์ด ์—†์œผ๋ฉด ๋””๋ ‰ํ† ๋ฆฌ๋Š” ['.']๋กœ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
*/
directories: string[];
/** ์ ์„ ํฌํ•จํ•œ ํ™•์žฅ์ž */
extension: string;
}) => boolean;

VersionsConfigโ€‹

type VersionConfig = {
/**
* ๋ฒ„์ „์˜ base ๊ฒฝ๋กœ๋Š”
* `baseUrl` + `routeBasePath`์— ์ถ”๊ฐ€๋ฉ๋‹ˆ๋‹ค.
*/
path?: string;
/** ๋ฐฐ์ง€, ๋“œ๋กญ๋‹ค์šด ๋“ฑ์— ์‚ฌ์šฉํ•  ๋ฒ„์ „ ๋ผ๋ฒจ์ž…๋‹ˆ๋‹ค. */
label?: string;
/** ํ•ด๋‹น ๋ฒ„์ „์˜ ๋ฌธ์„œ ์ƒ๋‹จ์— ํ‘œ์‹œํ•  ๋ฐฐ๋„ˆ์ž…๋‹ˆ๋‹ค. */
banner?: 'none' | 'unreleased' | 'unmaintained';
/** ๊ฐ ๋ฌธ์„œ ์ƒ๋‹จ์— ๋ฒ„์ „ ๋ผ๋ฒจ์ด ์žˆ๋Š” ๋ฐฐ์ง€๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. */
badge?: boolean;
/** ๊ฒ€์ƒ‰์—”์ง„์ด ์ด ๋ฒ„์ „์„ ์ธ๋ฑ์‹ฑํ•˜์ง€ ๋ชปํ•˜๋„๋ก ํ•ฉ๋‹ˆ๋‹ค */
noIndex?: boolean;
/** ๊ฐ ๋ฌธ์„œ์˜ <html> ์š”์†Œ์— ๋Œ€ํ•œ ์‚ฌ์šฉ์ž ์ง€์ • ํด๋ž˜์Šค๋ช… ์ถ”๊ฐ€ */
className?: string;
};

type VersionsConfig = {[versionName: string]: VersionConfig};

์„ค์ • ์˜ˆ์‹œโ€‹

ํ”„๋ฆฌ์…‹ ์˜ต์…˜์ด๋‚˜ ํ”Œ๋Ÿฌ๊ทธ์ธ ์˜ต์…˜์—์„œ ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ํŒ

๋Œ€๋ถ€๋ถ„์˜ ๋„ํ์‚ฌ์šฐ๋ฃจ์Šค ์‚ฌ์šฉ์ž๋Š” ํ”„๋ฆฌ์…‹ ์˜ต์…˜์„ ์‚ฌ์šฉํ•ด ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

If you use a preset, configure this plugin through the preset options:

docusaurus.config.js
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
path: 'docs',
breadcrumbs: true,
// Simple use-case: string editUrl
// editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
// Advanced use-case: functional editUrl
editUrl: ({versionDocsDirPath, docPath}) =>
`https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`,
editLocalizedFiles: false,
editCurrentVersion: false,
routeBasePath: 'docs',
include: ['**/*.md', '**/*.mdx'],
exclude: [
'**/_*.{js,jsx,ts,tsx,md,mdx}',
'**/_*/**',
'**/*.test.{js,jsx,ts,tsx}',
'**/__tests__/**',
],
sidebarPath: 'sidebars.js',
async sidebarItemsGenerator({
defaultSidebarItemsGenerator,
numberPrefixParser,
item,
version,
docs,
isCategoryIndex,
}) {
// ์ œ๊ณต๋œ ๋ฐ์ดํ„ฐ๋ฅผ ์‚ฌ์šฉํ•ด ์‚ฌ์šฉ์ž ์ง€์ • ์‚ฌ์ด๋“œ๋ฐ” ์Šฌ๋ผ์ด์Šค ์ƒ์„ฑ
return [
{type: 'doc', id: 'intro'},
{
type: 'category',
label: 'Tutorials',
items: [
{type: 'doc', id: 'tutorial1'},
{type: 'doc', id: 'tutorial2'},
],
},
];
},
numberPrefixParser(filename) {
// ์ž ์žฌ์ ์ธ ์ˆซ์ž ์ ‘๋‘์‚ฌ๋ฅผ ์ถ”์ถœํ•˜๋Š” ์—ฌ๋Ÿฌ๋ถ„๋งŒ์˜ ๋…ผ๋ฆฌ๋ฅผ ๊ตฌํ˜„ํ•ฉ๋‹ˆ๋‹ค.
const numberPrefix = findNumberPrefix(filename);
// ์ ‘๋‘์‚ฌ๋ฅผ ๋ฐœ๊ฒฌํ•˜๋ฉด ์ •๋ฆฌ๋œ ํŒŒ์ผ๋ช…๊ณผ ํ•จ๊ป˜ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
if (numberPrefix) {
return {
numberPrefix,
filename: filename.replace(prefix, ''),
};
}
// ์ˆซ์ž ์ ‘๋‘์‚ฌ๋ฅผ ๋ฐœ๊ฒฌํ•˜์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค.
return {numberPrefix: undefined, filename};
},
docLayoutComponent: '@theme/DocPage',
docItemComponent: '@theme/DocItem',
remarkPlugins: [require('remark-math')],
rehypePlugins: [],
beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [],
showLastUpdateAuthor: false,
showLastUpdateTime: false,
disableVersioning: false,
includeCurrentVersion: true,
lastVersion: undefined,
versions: {
current: {
label: 'Android SDK v2.0.0 (WIP)',
path: 'android-2.0.0',
banner: 'none',
},
'1.0.0': {
label: 'Android SDK v1.0.0',
path: 'android-1.0.0',
banner: 'unmaintained',
},
},
onlyIncludeVersions: ['current', '1.0.0', '2.0.0'],
},
},
],
],
};

๋งˆํฌ๋‹ค์šด ํ”„๋ŸฐํŠธ ๋งคํ„ฐโ€‹

๋งˆํฌ๋‹ค์šด ๋ฌธ์„œ์—์„œ๋Š” ---๋กœ ๊ฐ์‹ผ ๋งˆํฌ๋‹ค์šด ํ”„๋ŸฐํŠธ ๋งคํ„ฐ ์˜์—ญ์—์„œ ์•„๋ž˜์™€ ๊ฐ™์€ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ํ•„๋“œ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์„ค์ •ํ•  ์ˆ˜ ์žˆ๋Š” ํ•„๋“œ

์˜ต์…˜๋ช…ํƒ€์ž…๊ธฐ๋ณธ๊ฐ’์„ค๋ช…
idstringํŒŒ์ผ ๊ฒฝ๋กœ(ํ™•์žฅ์ž๋Š” ์ œ์™ธํ•˜๊ณ  ๋””๋ ‰ํ„ฐ๋ฆฌ๋Š” ํฌํ•จ)๊ณ ์œ ํ•œ ๋ฌธ์„œ ID
titlestring๋งˆํฌ๋‹ค์šด ์ œ๋ชฉ ๋˜๋Š” id๋ฌธ์„œ ์ œ๋ชฉ์ž…๋‹ˆ๋‹ค. ํŽ˜์ด์ง€ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋กœ ์‚ฌ์šฉํ•˜๋ฉฐ ์—ฌ๋Ÿฌ ์œ„์น˜(์‚ฌ์ด๋“œ๋ฐ”, ๋‹ค์Œ/์ด์ „ ๋ฒ„ํŠผ ๋“ฑ)์—์„œ ๋Œ€์ฒด๊ฐ’์œผ๋กœ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ๋งˆํฌ๋‹ค์šด ์ œ๋ชฉ์ด ์—†๋Š” ๊ฒฝ์šฐ ๋ฌธ์„œ ์ƒ๋‹จ์— ์ž๋™์œผ๋กœ ์ถ”๊ฐ€๋ฉ๋‹ˆ๋‹ค.
pagination_labelstringsidebar_label ๋˜๋Š” title๋ฌธ์„œ ๋‚ด์—์„œ ๋ฌธ์„œ์˜ ๋‹ค์Œ/์ด์ „ ๋ฒ„ํŠผ์— ํ‘œ์‹œํ•  ํ…์ŠคํŠธ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
displayed_sidebarstringundefinedํ˜„์žฌ ๋ฌธ์„œ๋ฅผ ํƒ์ƒ‰ํ•  ๋•Œ ์ง€์ •๋œ ์‚ฌ์ด๋“œ๋ฐ”๋ฅผ ๊ฐ•์ œ๋กœ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์—ฌ๋Ÿฌ ๊ฐœ์˜ ์‚ฌ์ด๋“œ๋ฐ” ์‚ฌ์šฉํ•˜๊ธฐ์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.
hide_titlebooleanfalse๋ฌธ์„œ ์ƒ๋‹จ ์ œ๋ชฉ์„ ์ˆจ๊ธธ์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค. ํ”„๋ŸฐํŠธ ๋งคํ„ฐ ์˜์—ญ์—์„œ ์„ค์ •ํ•œ ์ œ๋ชฉ๋งŒ ๊ฐ์ถฅ๋‹ˆ๋‹ค. ๋งˆํฌ๋‹ค์šด ๋ฌธ์„œ ๋‚ด์— ์ง€์ •๋œ ํƒ€์ดํ‹€์—๋Š” ์˜ํ–ฅ์„ ์ฃผ์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
hide_table_of_contentsbooleanfalse๋ชฉ์ฐจ๋ฅผ ์˜ค๋ฅธ์ชฝ์œผ๋กœ ์ˆจ๊ธธ์ง€ ์—ฌ๋ถ€
toc_min_heading_levelnumber2๋ชฉ์ฐจ์— ํ‘œ์‹œ๋˜๋Š” ์ตœ์†Œ ์ œ๋ชฉ ์ˆ˜์ค€์ž…๋‹ˆ๋‹ค. 2์—์„œ 6 ์‚ฌ์ด์˜ ๊ฐ’์œผ๋กœ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๊ณ  ์ตœ๋Œ“๊ฐ’๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค.
toc_max_heading_levelnumber3๋ชฉ์ฐจ์— ํ‘œ์‹œ๋˜๋Š” ์ตœ๋Œ€ ์ œ๋ชฉ ์ˆ˜์ค€์ž…๋‹ˆ๋‹ค. 2์—์„œ 6 ์‚ฌ์ด์˜ ๊ฐ’์œผ๋กœ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
pagination_nextstring | null์‚ฌ์ด๋“œ๋ฐ”์—์„œ ๋‹ค์Œ ๋ฌธ์„œํŽ˜์ด์ง€ ์ด๋™ ์˜์—ญ์—์„œ "๋‹ค์Œ" ํ•ญ๋ชฉ ๋งํฌ์— ์—ฐ๊ฒฐํ•  ๋ฌธ์„œ์˜ ID์ž…๋‹ˆ๋‹ค. ํ˜„์žฌ ํŽ˜์ด์ง€์—์„œ "๋‹ค์Œ" ํ•ญ๋ชฉ์— ๋ณด์—ฌ์ฃผ๊ณ  ์‹ถ์ง€ ์•Š๋‹ค๋ฉด null๋กœ ์„ค์ •ํ•˜์„ธ์š”.
pagination_prevstring | null์‚ฌ์ด๋“œ๋ฐ”์—์„œ ์ด์ „ ๋ฌธ์„œํŽ˜์ด์ง€ ์ด๋™ ์˜์—ญ์—์„œ "์ด์ „" ํ•ญ๋ชฉ ๋งํฌ์— ์—ฐ๊ฒฐํ•  ๋ฌธ์„œ์˜ ID์ž…๋‹ˆ๋‹ค. ํ˜„์žฌ ํŽ˜์ด์ง€์—์„œ "์ด์ „" ํ•ญ๋ชฉ์— ๋ณด์—ฌ์ฃผ๊ณ  ์‹ถ์ง€ ์•Š๋‹ค๋ฉด null๋กœ ์„ค์ •ํ•˜์„ธ์š”.
parse_number_prefixesbooleannumberPrefixParser ํ”Œ๋Ÿฌ๊ทธ์ธ ์˜ต์…˜๋ฌธ์„œ์—์„œ ๋ฒˆํ˜ธ ์ ‘๋‘์‚ฌ ๊ตฌ๋ฌธ ๋ถ„์„ ๋น„ํ™œ์„ฑํ™” ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค. ์ˆซ์ž ์ ‘๋‘์‚ฌ ์‚ฌ์šฉํ•˜๊ธฐ ํ•ญ๋ชฉ์„ ์ฐธ์กฐํ•˜์„ธ์š”.
custom_edit_urlstringeditUrl ํ”Œ๋Ÿฌ๊ทธ์ธ ์˜ต์…˜์„ ์‚ฌ์šฉํ•ด ๊ณ„์‚ฐ๋œ ๊ฐ’๋ฌธ์„œ๋ฅผ ํŽธ์ง‘ํ•˜๊ธฐ ์œ„ํ•œ URL
keywordsstring[]undefined๊ฒ€์ƒ‰ ์—”์ง„์—์„œ ํ•„์š”ํ•œ ๋ฌธ์„œ ํŽ˜์ด์ง€์˜ ํ‚ค์›Œ๋“œ ๋ฉ”ํƒ€ ํƒœ๊ทธ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
descriptionstring๋งˆํฌ๋‹ค์šด ์ฝ˜ํ…์ธ  ์ฒซ ๋ฒˆ์งธ ์ค„๋ฌธ์„œ์˜ ์„ค๋ช…์€ ๊ฒ€์ƒ‰์—”์ง„์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ <head> ํƒœ๊ทธ ์•ˆ์— <meta name="description" content="..."/>์™€ <meta property="og:description" content="..."/>๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค.
imagestringundefined๊ฒŒ์‹œ๊ธ€์— ๋Œ€ํ•œ ๋งํฌ๋ฅผ ํ‘œ์‹œํ•  ๋•Œ ๋ณด์—ฌ์ง€๋Š” ์ปค๋ฒ„ ๋˜๋Š” ์„ฌ๋„ค์ผ ์ด๋ฏธ์ง€๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
slugstringํŒŒ์ผ ๊ฒฝ๋กœ๋ฌธ์„œ URL์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ๋„๋ก ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค(/<routeBasePath>/<slug>). ์—ฌ๋Ÿฌ ํŒจํ„ด์„ ์„ค์ •ํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค: slug: my-doc, slug: /my/path/myDoc, slug: /.
tagsTag[]undefined๋ฌธ์„œ๋ฅผ ํƒœ๊ทธํ•˜๊ธฐ ์œ„ํ•œ ๋ฌธ์ž์—ด ๋˜๋Š” ์˜ค๋ธŒ์ ํŠธ์˜ ๋ชฉ๋ก์ž…๋‹ˆ๋‹ค. label๊ณผ permalink 2๊ฐœ์˜ ํ•„๋“œ๋กœ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค.
draftbooleanfalse๋ฌธ์„œ๊ฐ€ ์ž‘์—… ์ค‘์ž„์„ ๋‚˜ํƒ€๋‚ด๋Š” ๋ถ€์šธ ํ”Œ๋ž˜๊ทธ์ž…๋‹ˆ๋‹ค. Draft documents will only be displayed during development.
last_updateFileChangeundefined๋งˆ์ง€๋ง‰์œผ๋กœ ์—…๋ฐ์ดํŠธ๋œ ์ž‘์„ฑ์ž, ๋‚ ์งœ๋ฅผ ์žฌ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๋‚ ์งœ ํ˜•์‹์€ parsable date string์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.
type Tag = string | {label: string; permalink: string};
type FileChange = {date: string; author: string};

์˜ˆ:

---
id: doc-markdown
title: Docs Markdown Features
hide_title: false
hide_table_of_contents: false
sidebar_label: Markdown
sidebar_position: 3
pagination_label: Markdown features
custom_edit_url: https://github.com/facebook/docusaurus/edit/main/docs/api-doc-markdown.md
description: How do I find you when I cannot solve this problem
keywords:
- docs
- docusaurus
image: https://i.imgur.com/mErPwqL.png
slug: /myDoc
last_update:
date: 1/1/2000
author: custom author name
---

# Markdown Features

My Document Markdown content

i18nโ€‹

i18n ์†Œ๊ฐœ ๋ฌธ์„œ๋ฅผ ๋จผ์ € ํ™•์ธํ•ด์ฃผ์„ธ์š”.

๋ฒˆ์—ญ ํŒŒ์ผ ์œ„์น˜โ€‹

  • Base path: website/i18n/[locale]/docusaurus-plugin-content-docs
  • Multi-instance path: website/i18n/[locale]/docusaurus-plugin-content-docs-[pluginId]
  • JSON ํŒŒ์ผ: docusaurus write-translations ๋ช…๋ น ์‹คํ–‰ ํ›„ ๋งŒ๋“ค์–ด์ง„ ํŒŒ์ผ
  • Markdown files: website/i18n/[locale]/docusaurus-plugin-content-docs/[versionName]

ํŒŒ์ผ ์‹œ์Šคํ…œ ๊ตฌ์กฐ ์˜ˆโ€‹

website/i18n/[locale]/docusaurus-plugin-content-docs
โ”‚
โ”‚ # translations for website/docs
โ”œโ”€โ”€ current
โ”‚ โ”œโ”€โ”€ api
โ”‚ โ”‚ โ””โ”€โ”€ config.md
โ”‚ โ””โ”€โ”€ getting-started.md
โ”œโ”€โ”€ current.json
โ”‚
โ”‚ # translations for website/versioned_docs/version-1.0.0
โ”œโ”€โ”€ version-1.0.0
โ”‚ โ”œโ”€โ”€ api
โ”‚ โ”‚ โ””โ”€โ”€ config.md
โ”‚ โ””โ”€โ”€ getting-started.md
โ””โ”€โ”€ version-1.0.0.json