Getting Started

To get started using Markugen in your project, you will need to first install Markugen as a dependency. It is likely that you will be generating your documentation as a build/publish step; therefore, you may want to add --save-dev to the following commands to add it as a dev dependency.

Install Markugen

To install Markugen within your NodeJS project, execute one of the following commands:

npm
yarn
pnpm

npm install markugen

yarn add markugen

pnpm add markugen

npm

npm install markugen

yarn

yarn add markugen

pnpm

pnpm add markugen

Build Your Website

This section assumes you already have a markdown file or a set of markdown files. To generate your website, it is quite simple, just create an instance of the Markugen class and call generate. The following code assumes your markdown files are in a directory called markdown. If your markdown files are in a different folder, just change the input option to point to the location of the folder containing your markdown files.

.ts
// import markugen
import Markugen from 'markugen';

// create an instance
const mark = new Markugen();
// generate the website
await mark.generate({
  input: 'markdown',
});

Markugen will output the HTML files to a folder in your current working directory or cwd called output. If you would like to change the output location, provide Markugen with the output location via the output option like so:

.ts
// import markugen
import Markugen from 'markugen';

// create an instance
const mark = new Markugen();
// generate the website
await mark.generate({
  input: 'markdown',
  output: 'docs',
});

That's all folks!

Additional Options

Most of Markugen's options have default values associated with them. As a matter of fact, the only required option is the input option; all other options have defaults. A few things to note about the defaults:

Tip

Additional options can be found in the Features Section of this documentation. There is also a full working example provided from start to finish that you can follow along with found here.