diff options
author | Jan Holesovsky <kendy@suse.cz> | 2010-12-10 22:13:33 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2010-12-10 22:13:33 +0100 |
commit | 04961b5798213de9c7983ac4be997cc46b3e3dd8 (patch) | |
tree | 42defd3a3df330b7a55cc6f2d47c108b061b69fd | |
parent | 90364d5e994dca3601fb006e51812dbf1f91f2b8 (diff) |
wikihelp: No separate paragraph for the definition of variable (fdo#32291).
-rwxr-xr-x | helpcontent2/to-wiki/wikiconv2.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/helpcontent2/to-wiki/wikiconv2.py b/helpcontent2/to-wiki/wikiconv2.py index de096c3a38..cfe5fcda2f 100755 --- a/helpcontent2/to-wiki/wikiconv2.py +++ b/helpcontent2/to-wiki/wikiconv2.py @@ -49,6 +49,7 @@ replace_paragraph_role = \ 'tablenextpara': '\n', 'tablenextparacode': '\n<code>', 'tip': '{{Tip|', + 'variable': '', 'warning': '{{Warning|', }, 'end':{'code': '</code>\n\n', @@ -75,6 +76,7 @@ replace_paragraph_role = \ 'tablenextpara': '\n', 'tablenextparacode': '</code>\n', 'tip': '}}\n\n', + 'variable': '', 'warning': '}}\n\n', }, 'templ':{'code': False, @@ -101,6 +103,7 @@ replace_paragraph_role = \ 'tablenextpara': False, 'tablenextparacode': False, 'tip': True, + 'variable': False, 'warning': True, } } @@ -293,6 +296,11 @@ class ElementBase: var = parser.get_variable(id) if var != None: + try: + if var.role == 'variable': + var.role = 'paragraph' + except: + pass self.objects.append(var) elif parser.follow_embed: sys.stderr.write('Cannot find reference "#%s" in "%s".\n'% \ @@ -1000,7 +1008,7 @@ class Paragraph(ElementBase): def char_data(self, parser, data): if self.role == 'paragraph' or self.role == 'heading' or \ - self.role == 'listitem': + self.role == 'listitem' or self.role == 'variable': if data != '' and data[0] == ' ': data = ' ' + data.lstrip() data = data.replace('\n', ' ') @@ -1069,6 +1077,7 @@ class Variable(Paragraph): def __init__(self, attrs, parent): Paragraph.__init__(self, attrs, parent) self.name = 'variable' + self.role = 'variable' self.id = attrs['id'] def get_variable(self, id): |