Nine Pedestrians Mesmerized

    @saasmanual/generator

    0.0.13 • Public • Published

    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();

    Install

    npm i @saasmanual/generator

    DownloadsWeekly Downloads

    30

    Version

    0.0.13

    License

    Apache-2.0

    Unpacked Size

    22.6 kB

    Total Files

    11

    Last publish

    Collaborators

    • avatar