diff options
author | Andras Timar <andras.timar@collabora.com> | 2015-04-05 19:28:57 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-04-05 19:28:57 +0200 |
commit | 7e67bfc7ab1f013826154d1fef66cbcfc3d92892 (patch) | |
tree | 9dfd3396879a210cbd5818547e0cffc6471ebf89 /to-wiki | |
parent | c95a5afdf40bb9b86b702dd1ca6e6d5bcc51d2e6 (diff) |
wikihelp: support note/tip/warning in table cells
Change-Id: Ib70a16166e73ef3ffcff09588ea8fb93523cee17
Diffstat (limited to 'to-wiki')
-rwxr-xr-x | to-wiki/wikiconv2.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/to-wiki/wikiconv2.py b/to-wiki/wikiconv2.py index 48143f1367..a04e2dac0d 100755 --- a/to-wiki/wikiconv2.py +++ b/to-wiki/wikiconv2.py @@ -52,9 +52,15 @@ replace_paragraph_role = \ 'sup' : '', 'tablecontent': '| | ', 'tablecontentcode': '| | <code>', + 'tablecontentnote': '| |{{Note|', + 'tablecontenttip': '| |{{Tip|', + 'tablecontentwarning': '| |{{Warning|', 'tablehead': '! scope="col" | ', + 'tablenextnote': '\n{{Note|', 'tablenextpara': '\n', 'tablenextparacode': '\n<code>', + 'tablenexttip': '\n{{Tip|', + 'tablenextwarning': '\n{{Warning|', 'tip': '{{Tip|', 'variable': '', 'warning': '{{Warning|', @@ -82,9 +88,15 @@ replace_paragraph_role = \ 'sup' : '', 'tablecontent': '\n', 'tablecontentcode': '</code>\n', + 'tablecontentnote': '}}\n\n', + 'tablecontenttip': '}}\n\n', + 'tablecontentwarning': '}}\n\n', 'tablehead': '\n', + 'tablenextnote': '}}\n\n', 'tablenextpara': '\n', 'tablenextparacode': '</code>\n', + 'tablenexttip': '}}\n\n', + 'tablenextwarning': '}}\n\n', 'tip': '}}\n\n', 'variable': '', 'warning': '}}\n\n', @@ -112,9 +124,15 @@ replace_paragraph_role = \ 'sup' : False, 'tablecontent': False, 'tablecontentcode': False, + 'tablecontentnote': True, + 'tablecontenttip': True, + 'tablecontentwarning': True, 'tablehead': False, + 'tablenextnote': True, 'tablenextpara': False, 'tablenextparacode': False, + 'tablenexttip': True, + 'tablenextwarning': True, 'tip': True, 'variable': False, 'warning': True, @@ -1122,6 +1140,12 @@ class Paragraph(ElementBase): if not self.is_first and role.find('table') == 0: if role == 'tablecontentcode': role = 'tablenextparacode' + elif role == 'tablecontentnote': + role = 'tablenextnote' + elif role == 'tablecontenttip': + role = 'tablenexttip' + elif role == 'tablecontentwarning': + role = 'tablenextwarning' else: role = 'tablenextpara' @@ -1224,6 +1248,12 @@ class TableContentParagraph(Paragraph): self.role = 'tablecontentcode' elif self.role == 'logocode': self.role = 'tablecontentcode' + elif self.role == 'note': + self.role = 'tablecontentnote' + elif self.role == 'tip': + self.role = 'tablecontenttip' + elif self.role == 'warning': + self.role = 'tablecontentwarning' else: self.role = 'tablecontent' if self.role == 'tablehead': |