#!/usr/bin/env ruby =begin ======================================================================= # MD2MAN-HTML 1 2014-10-26 3.0.2 ## NAME md2man-html - convert md2man(5) flavored markdown(7) into HTML ## SYNOPSIS `md2man-html` [*OPTION*]... [*FILE*] ## DESCRIPTION This program converts md2man(5) flavored markdown(7) input from the given *FILE* into HTML and then prints the result to the standard output stream. If *FILE* is not given, then the standard input stream is read in its place. ### Top-level headings Each component of the `.TH` directive in roff(7), described under "Top-level headings" in md2man(5), is wrapped in stylable `` elements as follows: ... ... ... ... ... ### Heading permalinks Self-referencing hyperlinks (for permanent linking) are added to headings by converting their labels into URI fragments that are unique (using a counter), lowercase, and squeezed and stripped of HTML tags and non-word characters. For example, a heading labeled `VeriON 3(2!4)))` would be emitted as:

VeriON 3(2!4)))

For example, multiple headings labeled `Hello, world!` would be emitted as:

Hello, world!

Hello, world!

Hello, world!

### Cross references Cross references to manual pages are emitted as HTML hyperlinks that have `class="md2man-reference"` and `href="../man$SECTION/$PAGE.$SECTION.html"` attributes. For example, the `printf(3)` cross reference would be emitted as this HTML: printf(3) ## OPTIONS `-h`, `--help` Show this help manual. ## SEE ALSO md2man-roff(1), md2man-rake(1), md2man(5) =end ========================================================================= require 'binman' BinMan.help require 'md2man/html/engine' puts Md2Man::HTML::ENGINE.render(ARGF.read)