Class Asciidoctor::Converter::ManPageConverter
In: lib/asciidoctor/converter/manpage.rb
Parent: Converter::BuiltIn

A built-in {Converter} implementation that generates the man page (troff) format.

The output follows the groff man page definition while also trying to be consistent with the output produced by the a2x tool from AsciiDoc Python.

See www.gnu.org/software/groff/manual/html_node/Man-usage.html#Man-usage

Methods

Constants

LF = %(\n)
TAB = %(\t)
WHITESPACE = %(#{LF}#{TAB} )
ET = ' ' * 8
ESC = %(\u001b)
ESC_BS = %(#{ESC}\\)
ESC_FS = %(#{ESC}.)

External Aliases

skip -> page_break
  TODO use Page Control www.gnu.org/software/groff/manual/html_node/Page-Control.html#Page-Control
content -> preamble
skip -> toc

Public Instance methods

audio(node, name = nil)

Alias for skip_with_warning

TODO implement title for dlist TODO implement horizontal (if it makes sense)

NOTE embedded doesn‘t really make sense in the manpage backend

image(node, name = nil)

Alias for skip_with_warning

TODO supposedly groff has footnotes, but we‘re in search of an example

NOTE use fake <BOUNDARY> element to prevent creating artificial word boundaries

Converts HTML entity references back to their original form, escapes special man characters and strips trailing whitespace.

It‘s crucial that text only ever pass through manify once.

str - the String to convert opts - an Hash of options to control processing (default: {})

       * :preserve_space a Boolean that indicates whether to preserve spaces (only expanding tabs) if true
         or to collapse all adjacent whitespace to a single space if false (default: true)
       * :append_newline a Boolean that indicates whether to append an endline to the result (default: false)
sidebar(node, name = nil)

Alias for skip_with_warning

FIXME: The reason this method is so complicated is because we are not receiving empty(marked) cells when there are colspans or rowspans. This method has to create a map of all cells and in the case of rowspans create empty cells as placeholders of the span. To fix this, asciidoctor needs to provide an API to tell the user if a given cell is being used as a colspan or rowspan.

FIXME git uses [verse] for the synopsis; detect this special case

[Validate]