From: Petr Machata <pmachata@redhat.com>
To: Mark Wielaard <mark@klomp.org>
Cc: Andrew Cagney <cagney@redhat.com>, frysk <frysk@sourceware.org>
Subject: Re: Put refpurposes one line for easy manpage generation.
Date: Fri, 04 Apr 2008 08:32:00 -0000 [thread overview]
Message-ID: <20080403222914.GA25866@hridell.englab.brq.redhat.com> (raw)
In-Reply-To: <1207256480.3545.14.camel@cc1341701-a.deven1.ov.home.nl>
[-- Attachment #1: Type: text/plain, Size: 919 bytes --]
On Thu, Apr 03, 2008 at 11:01:20PM +0200, Mark Wielaard wrote:
> Hi Andrew,
>
> On Thu, 2008-04-03 at 10:39 -0400, Andrew Cagney wrote:
> > I'm not fluent in XML either, however I still managed to hack up the
> > attached (from htdocs/bugzilla). Can we do something with that?
>
> Yes, you probably could. Note that all the rest of the manpage index
> generation is done with sed. You might need to replace all of that. But
> I wouldn't put too much work into it unless you really want to. It does
> work pretty well as is now.
While I agree xslt is the proper way, I also immediately know the sed
syntax. So here goes:
/<refpurpose>/{
:loop
/<\/refpurpose>/b break
N
b loop
:break
s,^.*<refpurpose>,,
s,</refpurpose>.*$,,
s,\(^[[:space:]]*\|[[:space:]]*$\),,g
s,[[:space:]]\+, ,g
p
q
}
Save to file and use like this:
$ sed -n -f foo.sed < foo.xml
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-04-03 22:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-03 14:10 Mark Wielaard
2008-04-03 14:25 ` Andrew Cagney
2008-04-03 14:40 ` Mark Wielaard
2008-04-03 21:03 ` Andrew Cagney
2008-04-03 21:11 ` Mark Wielaard
2008-04-04 8:32 ` Petr Machata [this message]
2008-04-04 9:16 ` Mark Wielaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080403222914.GA25866@hridell.englab.brq.redhat.com \
--to=pmachata@redhat.com \
--cc=cagney@redhat.com \
--cc=frysk@sourceware.org \
--cc=mark@klomp.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).