Docusaurus

Build documentation page with Docusaurus 2

There’s quite number of times we need to have a documentation page. Build them with mkdocs or readthedoc is fine but not pretty enough.

Image for post
Image for post
Photo by Amy Baugess on Unsplash

What you need to prepare

  • Nodejs
  • Yarn
  • and an IDE

docusaurus.config.js

Define information for docusaurus project, including structure of the page, url.

package.json

List of libraries needed

yarn.lock

The purpose of a lock file is to lock down the versions of the dependencies specified in a package.json file. This means that in a yarn.lock file, there is an identifier for every dependency and sub dependency that is used for a project.

sidebar.js

src folder

Define list of css and html structure, theme for the web site.

docs

List of markdown files for page content.

blog

List of blog in markdown format.

Run command

yarn run docusaurus serve --build --port 80 --host 10.208.209.14
Image for post
Image for post

Resource code you can find in here.

Thanks for reading my post.

~~PEACE~~

Written by

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store