convert.sed 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. s/</&lt;/g
  2. s/>/&gt;/g
  3. s/^%\(.*\)$/<!-- \1 -->/
  4. s/\([^\\]\)%\(.*\)$/<!-- \2 -->/
  5. /\\Declaration/,/\\Description/c\
  6. <descr>
  7. s%\\subsection{\([^{]*\)}%<topic><shortdescr>\1</shortdescr>%g
  8. s%\\section{\([^{]*\)}%<topic><shortdescr>\1</shortdescr>%g
  9. s%\\chapter{\([^{]*\)}%<topic><shortdescr>\1</shortdescr>%g
  10. s%\\begin{verbatim}%</p>\n<code>%g
  11. s%\\end{verbatim}%</code>\n<p>%g
  12. s%\\var{\([^{]*\)}%<var>\1</var>%g
  13. s%\\em{\([^{]*\)}%<em>\1</em>%g
  14. s%{\\em\([^{]*\)}%<em>\1</em>%g
  15. s%\\file{\([^{]*\)}%<file>\1</file>%g
  16. s%\\menu{\([^{]*\)}%<var>\1</var>%g
  17. s%\\key{\([^{]*\)}%<var>\1</var>%g
  18. s%\\see[pf]l{\([^{]*\)}{\([^{]*\)}%<link id="\2">\1</link>%g
  19. s%\\seeconstl{\([^{]*\)}{\([^{]*\)}%<link id="\2">\1</link>%g
  20. s%\\seetypel{\([^{]*\)}{\([^{]*\)}%<link id="\2">\1</link>%g
  21. s%\\seevarl{\([^{]*\)}{\([^{]*\)}%<link id="\2">\1</link>%g
  22. s%\\see[pf]{\([^{]*\)}%<link id="\1"/>%g
  23. s%\\seevar{\([^{]*\)}%<link id="\1"/>%g
  24. s%\\seetype{\([^{]*\)}%<link id="\1"/>%g
  25. s%\\seeconst{\([^{]*\)}%<link id="\1"/>%g
  26. s%\\seec{\([^{]*\)}%<link id="\1"/>%g
  27. s%\\seet{\([^{]*\)}%<link id="\1"/>%g
  28. s%\\sees{\([^{]*\)}%<link id="\1"/>%g
  29. s%\\seeo{\([^{]*\)}%<link id="\1"/>%g
  30. s%\\seefig{\([^{]*\)}%<link id="\1"/>%g
  31. s%\\Errors%</descr>\n<errors>%g
  32. s%\\SeeAlso%</errors>\n<seealso>%
  33. s%\\end{functionl*}%</seealso>\n</element>%g
  34. s%\\end{procedurel*}%</seealso>\n</element>%g
  35. s%\\end{propertyl*}%</seealso>\n</element>%g
  36. s%\\end{methodl*}%</seealso>\n</element>%g
  37. s%\\end{typel*}%</seealso>\n</element>%g
  38. s%\\end{constantl*}%</seealso>\n</element>%g
  39. s%\\begin{functionl}{\([^{]*\)}{\([^{]*\)}%<element name="\1">%g
  40. s%\\begin{function}{\([^{]*\)}%<element name="\1">%g
  41. s%\\begin{typel}{\([^{]*\)}{\([^{]*\)}%<element name="\1">%g
  42. s%\\begin{type}{\([^{]*\)}%<element name="\1">%g
  43. s%\\begin{varl}{\([^{]*\)}{\([^{]*\)}%<element name="\1">%g
  44. s%\\begin{var}{\([^{]*\)}%<element name="\1">%g
  45. s%\\begin{constl}{\([^{]*\)}{\([^{]*\)}%<element name="\1">%g
  46. s%\\begin{const}{\([^{]*\)}%<element name="\1">%g
  47. s%\\begin{procedure}{\([^{]*\)}%<element name="\1">%g
  48. s%\\begin{procedurel}{\([^{]*\)}{\([^{]*\)}%<element name="\1">%g
  49. s%\\FPCexample{\([^{]*\)}%<example file="\1"/>%
  50. s%\\begin{remark}%</p>\n<remark>%g
  51. s%\\end{remark}%</remark>\n<p>%g
  52. s%\\\\%<br/>%g
  53. s%\\begin{funclist}%<table>\n<th><td>Name</td><td>Description</td></th>%g
  54. s%\\end{funclist}%</table>%g
  55. s%\\funcref{\([^{]*\)}{\([^{]*\)}%<tr><link id="\1"/><td>\2</td></tr>%g
  56. s%\\funcrefl{\([^{]*\)}{\([^{]*\)}{\([^{]*\)}%<tr><link id="\2">\1</link><td>\3</td></tr>%g
  57. s%\\procref{\([^{]*\)}{\([^{]*\)}%<tr><link id="\1"/><td>\2</td></tr>%g
  58. s%\\procrefl{\([^{]*\)}{\([^{]*\)}{\([^{]*\)}%<tr><link id="\2">\1</link><td>\3</td></tr>%g
  59. s%>,[[:space:]]*<link%>\n<link%g
  60. /\\begin{description}/,/\\end{description}/{
  61. s%\\begin{description}%<dl>%g
  62. s%\\end{description}%</dd>\n</dl>\n<p>%g
  63. s%\\item\[\(.*\)]%</dd>\n<dt>\1</dt>\n<dd>%g
  64. }
  65. /\\begin{itemize}/,/\\end{itemize}/{
  66. s%\\begin{itemize}%</p>\n<ul>%g
  67. s%\\end{itemize}%</li>\n</ul>\n<p>%g
  68. s%\\item%</li>\n<li>%g
  69. }
  70. /\\begin{enumerate}/,/\\end{enumerate}/{
  71. s%\\begin{enumerate}%</p><ol>%g
  72. s%\\end{enumerate}%</li>\n</ol>\n<p>%g
  73. s%\\item%</li>\n<li>%g
  74. }
  75. s%\\linux%linux%g
  76. s%\\unix%unix%g
  77. s%\\dos%dos%
  78. s%\\msdos%ms-dos%g
  79. s%\\ostwo%os/2%g
  80. s%\\windows%Windows%g
  81. s%\\windowsnt%Windows NT%g
  82. s%\\macos%Mac OS%g
  83. s%\\fpc%Free Pascal%g
  84. s%\\gnu%gnu%g
  85. s%\\atari%Atari%g
  86. s%\\amiga%Amiga%g
  87. s%\\solaris%Solaris%g
  88. s%\\qnx%QNX Realtime platform%g
  89. s%\\beos%BeOS%g
  90. s%\\palmos%PalmOS%g
  91. s%\\netbsd%NetBSD%g
  92. s%\\openbsd%OpenBSD%g
  93. s%\\win%Win32%g
  94. s%\\freebsd%FreeBSD%g
  95. s%\\tp%Turbo Pascal%g
  96. s%\\delphi%Delphi%g