免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
论坛 程序设计 Perl Pod问题
最近访问板块 发新帖
查看: 2354 | 回复: 3
打印 上一主题 下一主题

Pod问题 [复制链接]

论坛徽章:
1
狮子座
日期:2013-12-16 16:09:24
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-05-11 11:16 |只看该作者 |倒序浏览
5可用积分
有没有办法让apache网站支持pod文件或包含pod的pm文件做自动HTML解析
类似此网站效果:
http://search.cpan.org/~rgiersig/Expect-1.21/Expect.pod

论坛徽章:
0
2 [报告]
发表于 2010-05-11 11:26 |只看该作者
perl本身提供了一个pod2hml的工具,可以通过它生成你想要的格式文档

  1. pod2html --help
  2. Usage:  /usr/bin/pod2html --help --htmlroot=<name> --infile=<name> --outfile=<name>
  3.            --podpath=<name>:...:<name> --podroot=<name>
  4.            --libpods=<name>:...:<name> --recurse --verbose --index
  5.            --netscape --norecurse --noindex --cachedir=<name>

  6.   --backlink     - set text for "back to top" links (default: none).
  7.   --cachedir     - directory for the item and directory cache files.
  8.   --css          - stylesheet URL
  9.   --flush        - flushes the item and directory caches.
  10.   --[no]header   - produce block header/footer (default is no headers).
  11.   --help         - prints this message.
  12.   --hiddendirs   - search hidden directories in podpath
  13.   --htmldir      - directory for resulting HTML files.
  14.   --htmlroot     - http-server base directory from which all relative paths
  15.                    in podpath stem (default is /).
  16.   --[no]index    - generate an index at the top of the resulting html
  17.                    (default behaviour).
  18.   --infile       - filename for the pod to convert (input taken from stdin
  19.                    by default).
  20.   --libpods      - colon-separated list of pages to search for =item pod
  21.                    directives in as targets of C<> and implicit links (empty
  22.                    by default).  note, these are not filenames, but rather
  23.                    page names like those that appear in L<> links.
  24.   --outfile      - filename for the resulting html file (output sent to
  25.                    stdout by default).
  26.   --podpath      - colon-separated list of directories containing library
  27.                    pods (empty by default).
  28.   --podroot      - filesystem base directory from which all relative paths
  29.                    in podpath stem (default is .).
  30.   --[no]quiet    - suppress some benign warning messages (default is off).
  31.   --[no]recurse  - recurse on those subdirectories listed in podpath
  32.                    (default behaviour).
  33.   --title        - title that will appear in resulting html file.
  34.   --[no]verbose  - self-explanatory (off by default).
  35.   --[no]netscape - deprecated, has no effect. for backwards compatibility only.
复制代码

论坛徽章:
0
3 [报告]
发表于 2010-05-11 18:30 |只看该作者
yes! you can.
configure apache: path rewrite rule.
- or -
write a cgi to call pod2html and as std. output to browser.

i.e.:
use strict;
# require for http header
print "content-type: tex/html\n\n";
# read std. input and write std. output
my $stdput = `perldoc CGI | pod2html`;
print $stdout;

论坛徽章:
1
狮子座
日期:2013-12-16 16:09:24
4 [报告]
发表于 2010-05-11 18:58 |只看该作者
回复 3# ulmer


    five points for "configure apache: path rewrite rule."

    愿求其详
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP