| 1 |
NAME |
| 2 |
|
| 3 |
Parse::Man - parse nroff-formatted manpages |
| 4 |
|
| 5 |
DESCRIPTION |
| 6 |
|
| 7 |
This abstract subclass of Parser::MGC recognises nroff grammar from a |
| 8 |
file or string value. It invokes methods when various nroff directives |
| 9 |
are encountered. It is intended that this class be used as a base |
| 10 |
class, with methods provided to handle the various directives and |
| 11 |
formatting options. Typically a subclass will store intermediate |
| 12 |
results in a data structure, building it as directed by these method |
| 13 |
invocations. |
| 14 |
|
| 15 |
TEXT CHUNK FORMATTING METHOD |
| 16 |
|
| 17 |
The following method is used to handle formatted text. Each call is |
| 18 |
passed a plain string value from the input content. |
| 19 |
|
| 20 |
chunk |
| 21 |
|
| 22 |
$parser->chunk( $text, %opts ) |
| 23 |
|
| 24 |
The %opts hash contains the following options: |
| 25 |
|
| 26 |
font => STRING |
| 27 |
|
| 28 |
The name of the current font (R, B, etc..) |
| 29 |
|
| 30 |
size => INT |
| 31 |
|
| 32 |
The current text size, relative to a paragraph base of 0. |
| 33 |
|
| 34 |
Other font requests that are found in \fX or \f(AB requests are handled |
| 35 |
by similarly-named methods. |
| 36 |
|
| 37 |
PARAGRAPH HANDLING METHODS |
| 38 |
|
| 39 |
The following methods are used to form paragraphs out of formatted text |
| 40 |
chunks. Their return values are ignored. |
| 41 |
|
| 42 |
para_TH |
| 43 |
|
| 44 |
$parser->para_TH( $name, $section ) |
| 45 |
|
| 46 |
Handles the .TH paragraph which gives the page title and section |
| 47 |
number. |
| 48 |
|
| 49 |
para_SH |
| 50 |
|
| 51 |
$parser->para_SH( $title ) |
| 52 |
|
| 53 |
Handles the .SH paragraph, which gives a section header. |
| 54 |
|
| 55 |
para_SS |
| 56 |
|
| 57 |
$parser->para_SS( $title ) |
| 58 |
|
| 59 |
Handles the .SS paragraph, which gives a sub-section header. |
| 60 |
|
| 61 |
para_TP |
| 62 |
|
| 63 |
$parser->para_TP( $opts ) |
| 64 |
|
| 65 |
Handles a .TP paragraph, which gives a term definition. |
| 66 |
|
| 67 |
para_IP |
| 68 |
|
| 69 |
$parser->para_IP( $opts ) |
| 70 |
|
| 71 |
Handles a .IP paragraph, which is indented like the definition part of |
| 72 |
a .TP paragraph. |
| 73 |
|
| 74 |
para_P |
| 75 |
|
| 76 |
$parser->para_P( $opts ) |
| 77 |
|
| 78 |
Handles the .P, .PP or .LP paragraphs, which are all synonyms for a |
| 79 |
plain paragraph content. |
| 80 |
|
| 81 |
para_EX |
| 82 |
|
| 83 |
$parser->para_EX( $opts ) |
| 84 |
|
| 85 |
Handles the .EX paragraph, which is example text; intended to be |
| 86 |
rendered in a fixed-width font without filling. |
| 87 |
|
| 88 |
AUTHOR |
| 89 |
|
| 90 |
Paul Evans <[email protected]> |
| 91 |
|