Reading the docs
p6doc - the Raku pod reader
INTRODUCTION
Program p6doc
is a command-line-interface (CLI) program that reads Raku pod from installed modules' source code, in contrast to running perl6 --doc=MODULE programfile
which reads Raku pod from the named source file.
Note that p6doc
may not be installed automatically depending upon how you installed Rakudo Raku. To install it use zef
:
zef install p6doc
SYNOPSIS
p6doc [switches] [arguments]
DESCRIPTION
With no switches or arguments, p6doc
lists its help to $*OUT
(stdout
):
You want to maintain the index? To build an index for 'p6doc -f' p6doc build To list the index keys p6doc list To display module name(s) containing key p6doc lookup To show where the index file lives p6doc path-to-index What documentation do you want to read? Examples: p6doc Str p6doc Str.split p6doc faq p6doc path/to/file You can list some top level documents: p6doc -l You can also look up specific method/routine/sub definitions: p6doc -f hyper p6doc -f Array.push You can bypass the pager and print straight to stdout: p6doc -n Str
The text output can be captured and converted to other forms if desired.
If you want to use ANSI escape sequences, which will apply boldface and other enhancements to the output, you will have to set POD_TO_TEXT_ANSI, which is unset by default
export POD_TO_TEXT_ANSI=1
LIMITATIONS
Currently p6doc
can only extract embedded Raku pod from installed module source files (as listed in a distribution's META6.json
file). It is planned to add a feature for p6doc
(in conjunction with META6.json
changes) to extract all Raku pod in files included with the installed distribution.