A Kramdown convert for converting Markdown files into man pages.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
lib/kramdown
man
spec
.document
.gitignore
.rspec
.travis.yml
.yardopts
ChangeLog.md
Gemfile
LICENSE.txt
README.md
Rakefile
gemspec.yml
kramdown-man.gemspec

README.md

kramdown-man

Build Status

Description

A Kramdown convert for converting Markdown files into man pages.

Features

  • Converts markdown to roff:
    • Supports codespans, emphasis and strong fonts.
    • Supports normal, hanging and tagged paragraphs.
    • Supports bullet lists.
    • Supports multi-paragraph list items and blockquotes.
    • Supports horizontal rules.
    • Supports converting [bash](man:bash(1)) links into man page references.
  • Provides Rake task for converting man/*.md into man pages.
  • Uses the pure-Ruby Kramdown markdown parser.
  • Supports Ruby 1.9.x, 2.0.x, 2.1.x, 2.2.x, JRuby, Rubinius.

Synopsis

Render a man page from markdown:

$ kramdown-man <man/myprog.1.md >man/myprog.1

Examples

Render a man page from a markdown file:

require 'kramdown/man'

doc = Kramdown::Document.new(File.read('man/kramdown-man.1.md'))
File.write('man/kramdown-man.1',doc.to_man)

system 'man', 'man/kramdown-man.1'

Define a man and file tasks which render all *.md files within the man/ directory:

require 'kramdown/man/task'
Kramdown::Man::Task.new

Syntax

Formatting

`code`

code

*emphasis*

emphasis

**strong**

strong

Paragraphs

Normal paragraph.

Normal paragraph.

`command` [`--foo`] *FILE*

command [--foo] FILE

`--tagged`
  Text here.

--tagged Text here.

Links

[website](http://example.com/)

website

[bash](man:bash(1))

bash

Email <bob@example.com>

Email bob@example.com

Lists

* one
* two
* three

  extra paragraph
  • one

  • two

  • three

    extra paragraph

    1. one

    2. two

    3. three

      extra paragraph

  1. one

  2. two

  3. three

    extra paragraph

Horizontal Rule

-------------------------------------------------------------------------------

Blockquotes

> Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
>
> --Antoine de Saint-Exupéry

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.

--Antoine de Saint-Exupéry

Code Blocks

    #include <stdio.h>

    int main()
    {
	    printf("hello world\n");
	    return 0;
    }

#include <stdio.h>

int main()
{
    printf("hello world\n");
    return 0;
}

Requirements

Install

$ gem install kramdown-man

Alternatives

Copyright

Copyright (c) 2013-2015 Hal Brodigan

See {file:LICENSE.txt} for details.