1 from match
import Match
4 class dbk2htm_conversion
:
5 mapping
= { "<screen>" : "<pre>", "</screen>" : "</pre>",
6 "<para>" : "<p>", "</para>" : "</p>" ,
7 "<function>" : "<link>", "</function>" : "</link>" }
10 def section2html(self
, text
):
11 for str in self
.mapping
:
12 text
= string
.replace(text
, str, self
.mapping
[str])
14 def paramdef2html(self
, text
):
16 txt
= text
& s(r
"\s+<paramdef>") >> r
"\n<nobr>"
17 txt
&= s(r
"<paramdef>") >> r
"<nobr>"
18 txt
&= s(r
"</paramdef>") >> r
"</nobr>"
19 txt
&= s(r
"<parameters>") >> r
"\n <code>"
20 txt
&= s(r
"</parameters>") >> r
"</code>\n"
23 def section2html(text
):
24 return dbk2htm_conversion().section2html(text
)
25 def paramdef2html(text
):
26 return dbk2htm_conversion().paramdef2html(text
)