Pod::Thread(3pm)

Pod::Thread3pm

Convert pod data to the html macro language thread

Usage

    use Pod::Thread;
    my $parser = Pod::Thread->new;
    # Read POD from STDIN and write to STDOUT.
    $parser->parse_from_filehandle;
    # Read POD from file.pod and write to file.th.
    $parser->parse_from_file ('file.pod', 'file.th');

Overview

Pod::Thread is a module that can convert documentation in the POD format (the preferred language for documenting Perl) into thread, an HTML macro language. It lets the converter from thread to HTML handle some of the annoying parts of conversion to HTML.

Pod::Thread is primarily intended for use with the DocKnot static site generator (the App::DocKnot::Spin module), which implements the thread macro language. This module provides POD formatting into thread and thus to HTML.

As a derived class from Pod::Simple, Pod::Thread supports the same methods and interfaces. Briefly, one creates a new parser with Pod::Thread->new(), sets the output destination with either output_fh() or output_string(), and then calls one of parse_file(), parse_string_document(), or parse_lines(). See Pod::Simple for all the details.

new() can take the following options, in the form of key/value pairs, to control the behavior of the formatter:

contents

If set to a true value, output a table of contents section at the beginning of the document. Only top-level headings will be shown.

navbar

If set to a true value, output a navigation bar at the beginning of the document with links to all top-level headings.

style

Sets the name of the style sheet to use. If not given, no reference to a style sheet will be included in the generated page.

title

The title of the document. If this is set, it will be used rather than looking for and parsing a NAME section in the POD file, and NAME sections will no longer be required or special.

Diagnostics

Cannot write to output: %s

(F) An error occurred while attempting to write the thread result to the configured output string or file handle.

POD document had syntax errors

(F) The POD document being formatted had syntax errors.

Releases

Unchanged in 2 releases since Debian 12 (Bookworm).

  1. 12–13

Author

Russ Allbery <[email protected]>, based heavily on Pod::Text from podlators.

From libpod-thread-perl 3.01-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.