10 Feb 2022 19:32:17 UTC
- Distribution: Parse-Man
- Module version: 0.03
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (89 / 4 / 3)
- KwaliteeBus factor: 1
- 80.53% Coverage
- License: perl_5
- Perl: v5.14.0
- Activity24 month
- Download (21.46KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionPEVANS Paul Evans
- TEXT CHUNK FORMATTING METHOD
- PARAGRAPH HANDLING METHODS
Parse::Man- parse nroff-formatted manpages
This abstract subclass of Parser::MGC recognises nroff grammar from a file or string value. It invokes methods when various nroff directives are encountered. It is intended that this class be used as a base class, with methods provided to handle the various directives and formatting options. Typically a subclass will store intermediate results in a data structure, building it as directed by these method invocations.
The following method is used to handle formatted text. Each call is passed a plain string value from the input content.
$parser->chunk( $text, %opts )
%optshash contains the following options:
- font => STRING
The name of the current font (
- size => INT
The current text size, relative to a paragraph base of 0.
Other font requests that are found in
\f(ABrequests are handled by similarly-named methods.
The following methods are used to form paragraphs out of formatted text chunks. Their return values are ignored.
$parser->para_TH( $name, $section )
.THparagraph which gives the page title and section number.
$parser->para_SH( $title )
.SHparagraph, which gives a section header.
$parser->para_SS( $title )
.SSparagraph, which gives a sub-section header.
$parser->para_TP( $opts )
.TPparagraph, which gives a term definition.
$parser->para_IP( $opts )
.IPparagraph, which is indented like the definition part of a
$parser->para_P( $opts )
.LPparagraphs, which are all synonyms for a plain paragraph content.
$parser->para_EX( $opts )
.EXparagraph, which is example text; intended to be rendered in a fixed-width font without filling.
Paul Evans <email@example.com>