如何为Perl代码注释生成HTML文档? [英] How can I generate HTML documentation for Perl code comments?

查看:239
本文介绍了如何为Perl代码注释生成HTML文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经掌握了与各种Perl脚本一起使用的一堆代码的所有权。有些文档以嵌入在这些脚本中的注释形式(不是Pod),我想以HTML格式提取和浏览。



基本上,我正在寻找像javadoc或rubydoc这样的东西,但是对于Perl来说。 perldoc似乎是一个明显的搜索字符串,但我猜这只是Perl本身的文档。 perlpod也出现了,但我正在寻找一些可以提取代码中已经存在的注释,而不需要特别格式化的东西。 (不得不添加额外的位似乎是适得其反)。



无论我选择什么工具,我想指向代码,并递归地找到Perl文件,生成文档,并将其保存在我选择的目录中。它也应该是跨平台的(Windows XP,7,Mac OS X和Ubuntu Linux)。 Perl写的东西似乎有资格。



您可以推荐哪些选项?



对不起我的无知 - 我从来没有做过太多的简单的东西,Perl之前。

解决方案

我没有任何经验,但 Pod :: Autopod 看起来很有趣。它附带了命令行实用程序 autopod


autopod - 使用Perl库Pod :: Autopod生成具有pod语法的类似Javadoc的文档。它旨在了解类风格的perl代码,通常是PM文件。


这可能值得一看。请让我们知道您是否尝试过。


I've come into ownership of a bunch of code that's held together with various Perl scripts. There's some documentation in the form of comments (not Pod) embedded in these scripts that I'd like to be able to extract and browse in an HTML format.

Basically, I'm looking for something like javadoc or rubydoc, but for Perl. "perldoc" seemed like an obvious search string, but I guess that's just the documentation for Perl itself. "perlpod" also came up, but I'm looking for something that extracts comments that already exist in the code without much special formatting. (Having to add extra bits would seem to be counterproductive.)

Whatever tool I choose, I'd like to point it to the code and have it recursively find Perl files, generate documentation, and save it in a directory that I choose. It should also be cross-platform (Windows XP, 7, Mac OS X, and Ubuntu Linux). Something written in Perl itself would seem to qualify. It also should play nicely with other programming languages, if possible.

What are some options you'd recommend?

Sorry for my ignorance -- I've never done much beyond simple stuff with Perl before.

解决方案

I do not have any experience with it, but Pod::Autopod looks interesting. It comes with a command line utility autopod.

autopod - using the Perl library Pod::Autopod to generate javadoc like documentation with pod syntax. It is designed to understand perl code in class style, so typically PM files.

It might be worth a look. Please let us know if you do try it out.

这篇关于如何为Perl代码注释生成HTML文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆