0.0.13 • Published 3 years ago

@saasmanual/generator v0.0.13

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
3 years ago

Welcome to Generator

Unit Tests

Generator is a simple site generator which is used for SaaS Manual.

Installation

First you need to install the SaaS Manual Generator package:

npm install @saasmanual/generator

Usage

Now you can create a new file, say blog.js and invoke the generator:

import {Generator} from '../src/generator';

(new Generator)
  .source('./content')
  .destination('./out')
  .templates('./templates')
  .build();

Make sure you have some Markdown content in the ./content directory. Also make sure you have a layout.njk in the ./templates directory. See here for a simple template example https://github.com/saasmanual/generator/blob/main/example/templates/layout.njk

Now you can just run the following command to generate your pages:

node -r esm blog.js

Plugins

You can write simple transformers which allows you to generate things like table of contents or anything else really. See the example below:

async function plugin(generator) {
  // Do stuff here
}

(new Generator)
  .source('./content')
  .destination('./out')
  .templates('./templates')
  .use(plugin)
  .build();
0.0.13

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago