Skip to main content

Boilerplate

This is example boilerplate for a markdown file. It includes examples of headings, paragraphs, blockquotes, lists, and inline code.

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

This is a paragraph with bold text and italic text, as well as bold and italic text.

Blockquote example.

Nested quote inside.

Example blockquote

Mollit irure magna Lorem sunt tempor ea sit. Qui et consectetur voluptate magna mollit minim veniam anim. Ullamco nisi reprehenderit amet ut irure incididunt et minim. Ea elit fugiat ex commodo laborum laboris ut anim do ad commodo anim. Consequat non magna qui mollit quis deserunt labore.

  • Unordered list item 1
  • Unordered list item 2
    • Nested unordered item
  1. Ordered list item 1
  2. Ordered list item 2
    1. Nested ordered item

Here is some inline code inside a paragraph.

First Term : This is the definition of the first term.

Second Term : This is one definition of the second term. : This is another definition of the second term.

note

Laborum incididunt eiusmod sunt proident. Ea qui ut sint qui in enim aliqua cillum exercitation irure est laborum dolor. Ipsum incididunt consectetur exercitation et consequat proident ad voluptate ipsum. Esse incididunt deserunt qui ea do consectetur labore pariatur.

tip

Laboris laborum nostrud non sunt qui minim veniam. Elit sint et officia veniam excepteur non dolore ut. Ex ut proident cupidatat officia elit nulla commodo sunt et ut sint eiusmod tempor eu. Dolore ipsum veniam irure do esse commodo occaecat minim minim quis nostrud eu minim fugiat. Magna exercitation tempor officia pariatur cupidatat est reprehenderit excepteur mollit ad. Fugiat anim minim est ullamco velit enim non mollit. Velit cillum labore excepteur sunt et et.

Breaking changes in minor versions

Features prefixed by experimental_ or unstable_ are subject to changes in minor versions, and not considered as Semantic Versioning breaking changes.

Features prefixed by v<MajorVersion>_ (v6_ v7_, etc.) are future flags that are expected to be turned on by default in the next major versions. These are less likely to change, but we keep the possibility to do so.

future API breaking changes should be easy to handle, and will be documented in minor/major version blog posts.

docusaurus.config.js
export default async function createConfigAsync() {
return {
title: 'Docusaurus',
url: 'https://docusaurus.io',
// your site config ...
};
}

Types

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: string};
/** Useful metadata for the version this sidebar belongs to. */
version: {contentPath: string; versionName: string};
/** All the docs of that version (unfiltered). */
docs: {
id: string;
title: string;
frontMatter: DocFrontMatter & Record<string, unknown>;
source: string;
sourceDirName: string;
sidebarPosition?: number | undefined;
}[];
/** Number prefix parser configured for this plugin. */
numberPrefixParser: PrefixParser;
/** The default category index matcher which you can override. */
isCategoryIndex: CategoryIndexMatcher;
/**
* key is the path relative to the doc content directory, value is the
* category metadata file's content.
*/
categoriesMetadata: {[filePath: string]: CategoryMetadata};
/**
* Useful to re-use/enhance the default sidebar generation logic from
* Docusaurus.
*/
defaultSidebarItemsGenerator: SidebarGenerator;
// Returns an array of sidebar items — same as what you can declare in
// sidebars.js, except for shorthands. See https://docusaurus.io/docs/sidebar/items
}) => Promise<SidebarItem[]>;

type CategoryIndexMatcher = (param: {
/** The file name, without extension */
fileName: string;
/**
* The list of directories, from lowest level to highest.
* If there's no dir name, directories is ['.']
*/
directories: string[];
/** The extension, with a leading dot */
extension: string;
}) => boolean;

Table Example

NameTypeDefaultDescription
pathstring'docs'Path to the docs content directory on the file system, relative to site directory.
editUrlstring | EditUrlFunctionundefinedBase URL to edit your site. The final URL is computed by editUrl + relativeDocPath. Using a function allows more nuanced control for each file. Omitting this variable entirely will disable edit links.
editLocalizedFilesbooleanfalseThe edit URL will target the localized file, instead of the original unlocalized file. Ignored when editUrl is a function.
editCurrentVersionbooleanfalseThe edit URL will always target the current version doc instead of older versions. Ignored when editUrl is a function.
routeBasePathstring'docs'URL route for the docs section of your site. DO NOT include a trailing slash. Use / for shipping docs without base path.
tagsBasePathstring'tags'URL route for the tags list page of your site. It is prepended to the routeBasePath.
includestring[]['**/*.{md,mdx}']Array of glob patterns matching Markdown files to be built, relative to the content path.
excludestring[]See example configurationArray of glob patterns matching Markdown files to be excluded. Serves as refinement based on the include option.
sidebarPathfalse | stringundefinedPath to a sidebars configuration file, loaded in a Node.js context. Use false to disable sidebars, or undefined to create a fully autogenerated sidebar.
tagsstring | false | null | undefinedtags.ymlPath to a YAML file listing pre-defined tags. Relative to the docs version content directories.
onInlineTags'ignore' | 'log' | 'warn' | 'throw'warnThe plugin behavior when docs contain inline tags (not appearing in the list of pre-defined tags, usually docs/tags.yml).