PODS2HTML(1p)
π PODS2HTML β the bestie guide π
okay so real talk, this is pods2html(1p) from the User Contributed Perl Documentation corner of the universe, and it's literally the glow-up machine for your POD docs. buckle up π
β¨ NAME β¨
pods2html β translate a tree of PODs to HTML π¦
πΈ SYNOPSIS πΈ
"pods2html" ["--base" url] ["--css" url] ["--empty"] ["--index" title]
["--module"] ["--"["no"]"toc"] ["--hr" level] ["--bgcolor" #rrggbb]
["--text" #rrggbb] ["--variables" values.pl] PODdir HTMLdir [template
[variable=value ...]]
π DESCRIPTION π
so here's the vibe: pods2html goes hunting through the whole directory tree rooted at PODdir and finds every single .pod and .pm file chilling in there. then it translates each POD into HTML and drops it into a matching parallel directory tree rooted at HTMLdir. it's giving mirror dimension but make it documentation π
and bestie, it makes those HTML files world-readable. sharing is caring, periodt.
if you hand it a template file, that template gets filled in by the Text::Template module and written to dest. here's the most minimal template ever, and it shows off every single variable that pods2html sets for you:
<html>
<head>
<base href="{$base}">
<link href="{$css}" rel="stylesheet" type="text/css">
<title>{$title}</title>
</head>
<body bgcolor="{$bgcolor}" text="{$text}">
{$toc}
{$body}
</body>
</html>
now, if you pass the --variables option, then the file values.pl gets executed with a do call before the template is filled in. and values.pl may contain arbitrary Perl code. no cap, arbitrary. the program fragments in the template are evaluated in the Pod::Tree::HTML package, so any variables that values.pl sets in this package will be available to the template. it's a whole little ecosystem π§
you can also set additional scalar variables right on the command line using the variable=value syntax. and here's the important bit: variables set on the command line override variables set in values.pl. command line stays winning π
π OPTIONS π
--baseurl β specifies a base URL for HTML links. your links gotta know where home is π--cssurl β specifies a Cascading Style Sheet for the generated HTML pages. and here are example rules for all the different HTML elements that may appear in a POD:
a:link { background: #ff8080 }
body { background: #f0f0f0 }
code { background: #c0ffc0 }
dd { background: #ffffe0 }
dl { background: #fffff0 }
dt { background: #ffffc0 }
h1 { background: #ffc0c0 }
h2 { background: #ffe0e0 }
hr { background: #ff0000; height: 5px }
i { background: #ffc0c0 }
li { background: #e0e0e0 }
ol { background: #fff0ff }
p { background: #f0f0ff }
pre { background: #f0fff0 }
ul { background: #f0ffff }
--emptyβ creates HTML files for empty PODs. if you don't pass this option, then no HTML file is created for empty PODs. empty pods stay invisible, as they should π--indextitle β writes an index of all the HTML files toHTMLDir/index.html. title is used as the title of the index page. cute little table of contents energy π--moduleβ ignores files in directories namedt/andblib/. super useful for translating PODs in a module development directory. bye bye build artifacts π--["no"]tocβ includes or omits the table of contents. default is to include the TOC. yes bestie, the TOC is on by default, you're welcome π--hrlevel β controls the profusion of horizontal lines in the output, like so:- level
0β none - level
1β between TOC and body - level
2β after each=head1 - level
3β after each=head1and=head2
- level
default is level 1. so you get exactly one little divider moment unless you ask for more β¨
--bgcolor#rrggbb β set the background color to#rrggbb. default is white. blank canvas slay π€--text#rrggbb β set the text color to#rrggbb. default is black. π€
π«Ά REQUIRES π«Ά
Pod::Tree::HTML, HTML::Stream
π BUGS π
the recursion check doesn't work on Win32. which means the program will enter an infinite recursion if HTMLdir is a subdirectory of PODdir. like, not me watching this thing eat itself forever π so yeah, don't nest them like that on Win32. consider this your vibe check.
β SEE ALSO β
pod2html, Pod::Tree::HTML
πΈ AUTHOR πΈ
Steven McDougall, <swmcd@world.std.com>
π COPYRIGHT π
Copyright (c) 1999-2010 by Steven McDougall. This program is free software; you can redistribute it and/or modify it under the same terms as Perl.
and that's the whole page bestie π¦ this iconic little manual shipped with perl v5.36.0 and got its timestamp on 2022-11-19, so go forth and translate your PODs, you absolute main character ππ
π¦ where this page comes from
- debian bookworm: libpod-tree-perl 1.31-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libpod-tree-perl 1.31-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libpod-tree-perl 1.31-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libpod-tree-perl 1.31-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpod-tree-perl 1.31-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms