aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_vimdoc.py
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-11-23 12:31:49 +0100
committerChristian Clason <c.clason@uni-graz.at>2022-12-02 16:05:00 +0100
commit0b05bd87c04f9cde5c84a062453619349e370795 (patch)
tree06acf9582bbebe0bdb0f84777c17c71aced62a97 /scripts/gen_vimdoc.py
parent9e1187e4896bebb481a3f9595155f2a40adbc45e (diff)
downloadrneovim-0b05bd87c04f9cde5c84a062453619349e370795.tar.gz
rneovim-0b05bd87c04f9cde5c84a062453619349e370795.tar.bz2
rneovim-0b05bd87c04f9cde5c84a062453619349e370795.zip
docs(gen): support language annotation in docstrings
Diffstat (limited to 'scripts/gen_vimdoc.py')
-rwxr-xr-xscripts/gen_vimdoc.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py
index a720f055ed..801c8ea790 100755
--- a/scripts/gen_vimdoc.py
+++ b/scripts/gen_vimdoc.py
@@ -496,7 +496,12 @@ def render_node(n, text, prefix='', indent='', width=text_width - indentation,
if n.nodeName == 'preformatted':
o = get_text(n, preformatted=True)
ensure_nl = '' if o[-1] == '\n' else '\n'
- text += '>{}{}\n<'.format(ensure_nl, o)
+ if o[0:4] == 'lua\n':
+ text += '>lua{}{}\n<'.format(ensure_nl, o[3:-1])
+ elif o[0:4] == 'vim\n':
+ text += '>vim{}{}\n<'.format(ensure_nl, o[3:-1])
+ else:
+ text += '>{}{}\n<'.format(ensure_nl, o)
elif is_inline(n):
text = doc_wrap(get_text(n), indent=indent, width=width)