1.0.1 • Published 2 years ago

markdown-magic-pulpo-schema v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years ago

Schema plugin

Add install command to markdown files via markdown-magic

Install

npm i markdown-magic markdown-magic-install-command --save-dev

Adding the plugin

See example.js for usage.

const Pulpo = require('pulpo');
const path = require('path');
const markdownMagic = require('markdown-magic');

const config = {
  transforms: {
    SCHEMA: require('./index.js')(new Pulpo({
      host: {
        description: 'Host for the server',
        type: 'string',
        default: 'localhost',
        argv: 'host'
      },
      port: {
        description: 'Port for dev server to run on',
        type: 'number',
        default: '3000',
        env: 'PORT'
      }
    }))
  }
}

const markdownPath = path.join(__dirname, 'README.md');
markdownMagic(markdownPath, config);

Usage in markdown

  • host (string) - Host for the server
    • default - localhost
    • argv - host
  • port (number) - Port for dev server to run on
    • default - 3000
    • env - PORT