[openbeos] Re: Haiku Book and Revision 19612

Niels Reedijk wrote:

The second tool is probably going to be a custom made tool. I thought
of a linking system to link between classes. In order to do this in a
less errorprone way I need to autogenerate a set of entities to link
between classes. Entities are aliases for longer pieces of docbook.
For example, I need to create an entity &BString_Length; that expands
to <link linkend="bstring_length"><function>Length()</function></link>.
Creating this manually is quite tedious (check midi2api.xml) so this
needs to be automated. I'm not very good at perl or python or any
other quick tool that can be used to write such a script, but I would
be able to explain very briefly to someone who can, what it should do
exactly.

Maybe it is just me, but I don't understand what you are getting at, here.
If what you wrote is, literally, what you want, then:
sed 's:
&\([^_]*\)_\([^;]*\):
<link linkend="\1"><function>\2()</function></link>' foo > foo.fixed

will do the trick (without the linewraps, of course)...

Other related posts: