diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:18:06 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:18:06 +0000 |
commit | 9e9d75224939029e63760bddc02d084846f49fe0 (patch) | |
tree | fbaf2cd0d33f54add493e6dfb943a46de15aad42 /debian/dconv/parser/seealso.py | |
parent | Adding upstream version 2.9.5. (diff) | |
download | haproxy-9e9d75224939029e63760bddc02d084846f49fe0.tar.xz haproxy-9e9d75224939029e63760bddc02d084846f49fe0.zip |
Adding debian version 2.9.5-1.debian/2.9.5-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/dconv/parser/seealso.py')
-rw-r--r-- | debian/dconv/parser/seealso.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/debian/dconv/parser/seealso.py b/debian/dconv/parser/seealso.py new file mode 100644 index 0000000..bbb53f9 --- /dev/null +++ b/debian/dconv/parser/seealso.py @@ -0,0 +1,32 @@ +import re +import parser + +class Parser(parser.Parser): + def parse(self, line): + pctxt = self.pctxt + + result = re.search(r'(See also *:)', line) + if result: + label = result.group(0) + + desc = re.sub(r'.*See also *:', '', line).strip() + + indent = parser.get_indent(line) + + # Some descriptions are on multiple lines + while pctxt.has_more_lines(1) and parser.get_indent(pctxt.get_line(1)) >= indent: + desc += " " + pctxt.get_line(1).strip() + pctxt.next() + + pctxt.eat_empty_lines() + pctxt.next() + pctxt.stop = True + + template = pctxt.templates.get_template("parser/seealso.tpl") + return template.render( + pctxt=pctxt, + label=label, + desc=desc, + ) + + return line |