grunt-markedman

a grunt-task for using marked-man to generate manpages from markdown


Keywords
gruntplugin, markdown, roff, ronn, man
License
MPL-2.0
Install
npm install grunt-markedman@1.0.0

Documentation

grunt-markedman

a grunt-task for using marked-man to generate manpages from markdown

Made possible by the guys behind marked-man and grunt. Thanks!

Getting Started

This plugin requires Grunt.

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-markedman --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-markedman');

The "markedman" task

Overview

In your project's Gruntfile, add a section named markedman to the data object passed into grunt.initConfig().

markedman: {
  options: {
    version: '<%= pkg.version %>',
    section: '3'
  },
  readme: {
    files: [
      {src: 'README.md', dest: '<%= pkg.name %>.3' }
    ]
  }
}

Options

options.version

Type: String Default value: ''

The version of your app.

options.section

Type: String Default value: '1'

The man-section, see wikipedia. In general use (1) for commands and (8) for services.

options.manual

Type: String Default value: ''

The MANUAL string shown in the manpage header. See marked-man doku.

options.src

Type: String Default value: 'readme.md'

Some markdown file to convert to man.

options.dest

Type: String Default value: 'dist/readme.1.man'

The destination of the generated manpage.

Usage Examples

A little bit more complex...

markedman: {
  options: {
    version: '<%= pkg.version %>',
    section: '3'
  },
  readme: {
    files: [
      {src: 'README.md', dest: '<%= pkg.name %>.3' }
    ]
  },
  main: {
    options: {
      section: '1'
    },
    files: [
      {src: 'doc/furtherDocs.md', dest: 'docA.1' },
      {src: 'doc/plentyOfDocs.md', dest: 'docB.1' }
    ]
  }
},

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.