Debian Codegraph @

upstream/mageia-cauldron/man3pm/Pod::Html::Util.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "Pod::Html::Util 3pm"
61 .TH Pod::Html::Util 3pm 2023-12-22 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 Pod::Html::Util \- helper functions for Pod\-Html
68 .SH SUBROUTINES
69 .IX Header "SUBROUTINES"
70 \&\fBNote:\fR While these functions are importable on request from
71 \&\fIPod::Html::Util\fR, they are specifically intended for use within (a) the
72 \&\fIPod\-Html\fR distribution (modules and test programs) shipped as part of the
73 Perl 5 core and (b) other parts of the core such as the \fIinstallhtml\fR
74 program. These functions may be modified or relocated within the core
75 distribution \-\- or removed entirely therefrom \-\- as the core\*(Aqs needs evolve.
76 Hence, you should not rely on these functions in situations other than those
77 just described.
78 .ie n .SS process_command_line()
79 .el .SS \f(CWprocess_command_line()\fP
80 .IX Subsection "process_command_line()"
81 Process command\-line switches (options). Returns a reference to a hash. Will
82 provide usage message if \f(CW\*(C`\-\-help\*(C'\fR switch is present or if parameters are
83 invalid.
84 .PP
85 Calling this subroutine may modify \f(CW@ARGV\fR.
86 .ie n .SS usage()
87 .el .SS \f(CWusage()\fP
88 .IX Subsection "usage()"
89 Display customary Pod::Html usage information on STDERR.
90 .ie n .SS unixify()
91 .el .SS \f(CWunixify()\fP
92 .IX Subsection "unixify()"
93 Ensure that \fIPod::Html\fR\*(Aqs internals and tests handle paths consistently
94 across Unix, Windows and VMS.
95 .ie n .SS relativize_url()
96 .el .SS \f(CWrelativize_url()\fP
97 .IX Subsection "relativize_url()"
98 Convert an absolute URL to one relative to a base URL.
99 Assumes both end in a filename.
100 .ie n .SS html_escape()
101 .el .SS \f(CWhtml_escape()\fP
102 .IX Subsection "html_escape()"
103 Make text safe for HTML.
104 .ie n .SS htmlify()
105 .el .SS \f(CWhtmlify()\fP
106 .IX Subsection "htmlify()"
107 .Vb 1
108 \& htmlify($heading);
109 .Ve
110 .PP
111 Converts a pod section specification to a suitable section specification
112 for HTML. Note that we keep spaces and special characters except
113 \&\f(CW\*(C`", ?\*(C'\fR (Netscape problem) and the hyphen (writer\*(Aqs problem...).
114 .ie n .SS anchorify()
115 .el .SS \f(CWanchorify()\fP
116 .IX Subsection "anchorify()"
117 .Vb 1
118 \& anchorify(@heading);
119 .Ve
120 .PP
121 Similar to \f(CWhtmlify()\fR, but turns non\-alphanumerics into underscores. Note
122 that \f(CWanchorify()\fR is not exported by default.
123 .ie n .SS trim_leading_whitespace()
124 .el .SS \f(CWtrim_leading_whitespace()\fP
125 .IX Subsection "trim_leading_whitespace()"
126 Remove any level of indentation (spaces or tabs) from each code block
127 consistently. Adapted from:
128 https://metacpan.org/source/HAARG/MetaCPAN\-Pod\-XHTML\-0.002001/lib/Pod/Simple/Role/StripVerbatimIndent.pm