【发布时间】:2015-05-16 00:37:05
【问题描述】:
我正在尝试弄清楚如何使用Doxygen::Filter::Perl 为 Perl 文件生成文档。我从一个非常简单的文件开始,只是为了看看我是否可以让它工作(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 (hakon.hagland@gmail.com)
#
# @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::Filter::Perl 并使用了 metacpan.org (the link is here) 的包维护者提供的 Doxyfile 配置文件
并将其放在与上面脚本相同的目录中。我在Doxyfile中更改了一行:INPUT标签的值从lib改为空字符串,以便只搜索当前目录的源文件..
我使用的是Ubuntu 14.04,所以我用sudo apt-get install doxygen安装了Doxygen,(我还需要安装graphviz:sudo apt-get install graphviz)然后我终于运行了
$ doxygen
从终端窗口。生成的 HTML 文件 doc/html/index.html 包含有关文件和作者的文档,但它不包含 add_one 子例程的任何文档。
我在这里错过了什么?
更新
以下是 Chromium 浏览器中类视图的外观:
正如所见,add_one 子例程没有引用/链接。
这是文件视图:
【问题讨论】:
-
您错过了 Perl 程序员使用 pod 的想法?
-
@mob 读完这个stackoverflow.com/questions/4722619/… 我决定试试 Doxygen :)