delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/10/25/19:11:48

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Fri, 26 Oct 2001 00:58:29 +0200
From: "Gerrit P. Haase" <gp AT familiehaase DOT de>
X-Mailer: The Bat! (v1.53d)
Reply-To: "Gerrit P. Haase" <libwww AT perl DOT org>
Organization: Esse keine toten Tiere
X-Priority: 3 (Normal)
Message-ID: <124471324168.20011026005829@familiehaase.de>
To: libwww AT perl DOT org
CC: cygwin AT cygwin DOT com
Subject: Re: Perl documentation
In-Reply-To: <01102410084000.06298@Legoland>
References: <01102410084000 DOT 06298 AT Legoland>
MIME-Version: 1.0
X-Hops: 1
X-Sender: 320081107336-0001 AT t-dialin DOT net

Hallo Martin,

Am 2001-10-24 um 10:10 schriebst du:

> Hi you,

> although the concern of my mail not actually within the topic of
> this mailing list, I think it will be of interest for you.
> After typing the following verses in a Linux shell you'll get the
> pod code within the pm's of your perl library transformed into
> html. The resulting HTML-document is being moved to
> /usr/local/doc/perl5, for instance. The directory tree there will
> parallel to that on /usr/lib/perl5 (or where ever you keep it).

> Requires: find, awk, tee, pod2html, a preinstalled destination
> directory.
> Lacks: Not all pm's contain pod code. There will be html-files with
> 0 bytes length, however.

> 1.) cd /usr/lib/perl5
> 2.) find -name \*.pm | awk '{dir=$1; html=gensub("\.pm","\.html","",dir);
>                          system("pod2html " $1 " | tee " html);
>                          sub("\.","\/usr\/local\/doc\/perl5",dir);
>                          sub("\/[[:alnum:]_-]*.pm","",dir);
>                          system("mkdir " dir);
>                          system("mv " html " " dir "/")}'

> Never mind the linefeeds in here, this is a one-liner. Always type the
> spaces exactly, as awk uses them for concatenation.

So why not write it down so we can copy and paste it?
And I suggest to use mkdir -p to get rid of the useless errors.

#!/usr/bin/sh
cd /usr/lib/perl5
find -name \*.pm |awk '{dir=$1; html=gensub("\.pm","\.html","",dir); \
                         system("pod2html " $1 " | tee " html); \
                         sub("\.","\/usr\/local\/doc\/perl5",dir); \
                         sub("\/[[:alnum:]_-]*.pm","",dir);   \
                         system("mkdir -p " dir);   \
                         system("mv " html " " dir "/")}'
# Happy Perl'ing;)

Ciao,

Gerrit P. Haase                            mailto:gp AT familiehaase DOT de
-- 
=^..^=


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019