Docusaurus Documentation Generator

Docusaurus is a documentation generator from Meta, formerly Facebook, and is often used to manage OSS manuals, announcements, and blogs.

docusaurus

What Is Docusaurus?

Docusaurus is an open-source project created by Facebook for building static websites. It is especially used by developers to write and host technical documentation. It is a React-based, user-friendly documentation tool, and documents can be written easily with Markdown.

Main features include user-friendly documentation, Markdown and MDX support, customizable layouts and themes, search integration through Algolia, responsive design, internationalization, a plugin system, and document versioning.

Environment

The article was verified in a macOS environment with Node.js and npx installed.

% node -v
v21.6.2
% npx -v
10.2.4

Creating a Project

Docusaurus provides a scaffold command for project creation.

$ npx @docusaurus/init@latest init [siteName] [template] [rootDir]
$ npx @docusaurus/init@latest init devkuma-mysite classic

After creation, move into the directory and start the site.

$ cd devkuma-mysite
$ npm start

The generated project contains directories such as blog/, docs/, src/, and static/, along with configuration files such as docusaurus.config.js and sidebars.js.

Customization

The first page can be customized by editing src/pages/index.js. The site header and navigation are configured in docusaurus.config.js, not in each individual page. Docusaurus automatically reloads the browser during development, so changes can be checked quickly.

Summary

Docusaurus is a useful tool for creating and managing documentation sites with Markdown, React, and a structured sidebar. For documentation-focused projects, the main files to edit are usually docs/, docusaurus.config.js, and sidebars.js.