Does Perl have a Perl Docs generator? Something like Java Docs or PHP Documenter?
Yes, it's called perldoc
You simply write documentation in the source, just like with javadoc.
Briefly, "=item" is a bulleted item, e.g. a function or a parameter "=over" goes down a level of identation, "=back" goes up a level. Use "=cut" where you want to switch back to perl code.
Here is an example of what it could look like:
=item $b->add_module ( %options )
Initialize a module. A module is a repository or a branch of a repository.
Valid options are
=over
=item id
Id of this module
=item repo
Url of repository. Currently only subversion repositories are supported.
=back
=cut
sub add_module($%)
{
Simply pass your perl code through the perldoc program to get the formatted documentation.
Why, yes. Yes, it does! Perldoc.
You mean perldoc?
Also see this related Stack Overflow quesion:
[just for googlers] As people already said, you make documentation with POD (not comments, comments are for maintainers, pod for user documentation). Usually you add your POD at the start and end of your script or module, and before each method), then you can use perldoc your_module
in the console, or pod2html
to convert to html and browse in a server, or use pdoc (it is a bit old but is very helpful when you want to have a web doc navigator and links to the code in the web).
there is a newer question about formatting the pod that could be also of your interest perl-documentation-pod-browsers
and this one how-can-i-generate-html-documentation-for-perl-code-comments
And there was another one talking about to do a pod2html and using a css file to mimic the cpansearch pages, but I can not find it now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With