I am trying to figure out how to use Doxygen::Filter::Perl
to generate documentation for Perl files. I am starting with a very simple file just to see if I can get it to work (test_doxygen.pl
):
#! /usr/bin/env perl
#** @file test_doxygen.pl
# @brief Testing Doxygen using Doxygen::Filter::Perl
#
# Description of the purpose of this file
#
# @author Håkon Hægland ([email protected])
#
# @bug No known bugs.
#
#*
#** @class main
# The main class
#*
use strict;
use warnings;
my $b = add_one(1);
#** @function public add_one ($par1)
# @brief A brief description of the function
#
# A detailed description of the function
# @params $par1 required A number
# @retval value Input value plus one1
#*
sub add_one {
my ($par1) = @_;
return $par1 + 1;
}
I then installed Doxygen::Filter::Perl and used the Doxyfile
configuration file provided by the package maintainer at metacpan.org (the link is here)
and put it in the same directory as the script above. I changed one line in the Doxyfile
: the value of the INPUT
tag was changed from lib
to the empty string, in order to only search the current directory for source files..
I am using Ubuntu 14.04, so I installed Doxygen with sudo apt-get install doxygen
, (I also needed to install graphviz
: sudo apt-get install graphviz
) then I finally run
$ doxygen
from the terminal window. The generated HTML file doc/html/index.html
contains documentation about the file and the author, but it does not contain any documentation for the add_one
sub routine.
What am I missing here?
Update
Here is how the class view looks like in Chromium browser:
As seen, there is no reference/link to the add_one
sub routine.
And here is the file view:
Doxygen (/ˈdɒksidʒən/ DOK-see-jən) is a documentation generator and static analysis tool for software source trees. When used as a documentation generator, Doxygen extracts information from specially-formatted comments within the code.
To create a Doxygen comment from scratch: Type one of the following symbols: /// , //! , /** or /*! and press Enter .
So the problem was with handling the "my" variable declaration. It set the value to be private: and doxygen never went back. I have added a line to Perl.pm to fix this and it should work for you now. Since you are working with pl files not pm files, I have also made changes to the Doxyfile, so you will want to get the new one from the distribution. I have published 1.71 to Github and CPAN and have tested it with your exact example.
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