我想弄清楚如何使用Doxygen::Filter::Perl
来生成Perl文件的文档。我开始用一个非常简单的文件,只是为了看看,如果我能得到它的工作(test_doxygen.pl
):如何使用Doxygen和Doxygen :: Filter :: Perl为Perl子例程生成文档?
#! /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;
}
我再装的Doxygen ::过滤器:: Perl和用于被包维护者提供的Doxyfile
配置文件在metacpan.org(the link is here) 并放在与上面的脚本相同的目录中。我在Doxyfile
改变一个线:INPUT
标签的值从lib
变更为空字符串,以仅搜索源文件的当前目录..
我使用Ubuntu 14.04,所以我安装的Doxygen与sudo apt-get install doxygen
,(I也需要安装graphviz
:sudo apt-get install graphviz
),那么我最终从终端窗口运行
$ doxygen
。生成的HTML文件doc/html/index.html
包含有关文件和作者的文档,但不包含add_one
子例程的任何文档。
我在这里错过了什么?
更新
下面是类视图看起来像在Chromium浏览器:
正如所看到的,没有参考/链接到add_one
子例程。
这里是文件视图:
您错过了Perl Progammers使用[pod](https://metacpan.org/pod/perlpod)的想法吗? – mob 2015-03-13 13:50:46
@mob在阅读本文后http://stackoverflow.com/questions/4722619/is-there-really-no-better-way-to-document-perl-code-than-pod我决定尝试Doxygen :) – 2015-03-13 13:54:00