1
# a very limited debiandoc to xml converter
2
# can also be used by itself on entity files,
3
# for those uncomment next line:
5
# ENTITY must upper case
7
# start links on a new line
8
s|<URL ID=\"\([^\"]*\)\" NAME=\"\([^\"]*\)\">|\
9
<ulink url="\1">\2</ulink>|gi
10
# pick up halves of those that got wrapped to different lines
11
s|<URL ID=\"\([^\"]*\)\"|\
14
s|^ID=\"\([^\"]*\)\" NAME=\"\([^\"]*\)\">|url="\1">\2</ulink>|gi
15
s|^NAME=\"\([^\"]*\)\">|\1</ulink>|gi
16
# ID= at the start of a line can also be an orphan ref
17
s|^ID=\"\(\&url[^\"]*\)\"|url="\1"></ulink>|gi
18
s|<REF ID=\"\([^\"]*\)\">|<xref linkend="\1"></xref>|gi
19
s|<^ID=\"\([^\"]*\)\">|linkend="\1"></xref>|gi
24
# An extra line is helpful when replacing with 2 tags
25
s|<ITEM>|<listitem><para>\
29
s|<EM>\([^<]*\)</EM>|<emphasis>\1</emphasis>|gi
31
s|</EM>|</emphasis>|gi
32
s|ENUMLIST>|orderedlist>|gi
33
s|TAGLIST>|variablelist>|gi
34
s|<TAG>|<varentry><term>\
37
s|<LIST COMPACT>|<itemizedlist>|gi
38
s|<LIST>|<itemizedlist>|gi
39
s|</LIST>|</itemizedlist>|gi
42
s|CHAPT ID=|chapter id=|gi
43
# xml has no plain <sect>, must be numbered
44
# so move each one up a level
49
s|SECT3 ID=|sect4 id=|gi
50
s|SECT2 ID=|sect3 id=|gi
51
s|SECT1 ID=|sect2 id=|gi
52
s|SECT ID=|sect1 id=|gi
53
# locate sect's with text immediately following, insert <title>
54
s|\(<sect[^>]*>\)\([^<>]\+$\)|\1<title>\2</title>|i
55
# prgn could be <application>, but use <command> as default
57
# our <example>s don't have headings, use <informalexample>
58
s|<EXAMPLE>|<informalexample><screen>\
61
</screen></informalexample>|gi
62
s|VAR>|replaceable>|gi
63
# <tt> has been used for many purposes, but it _should_ be <userinput>
65
# no <package> allowed, substitute <classname> for now
66
s|PACKAGE>|classname>|g
67
# just change the case
68
s|FOOTNOTE>|footnote>|gi
74
# all <para> to left margin on next line
77
s|^ *\(</para>.*\)|\1|
78
# sect's on next line, appropriate indent