aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_api_vimdoc.py
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-08-02 13:28:36 +0200
committerGitHub <noreply@github.com>2018-08-02 13:28:36 +0200
commit2b9fc9a13f1404260448c129762a2679ac688372 (patch)
treed252343457668ef7b5998f831669baf842f60cde /scripts/gen_api_vimdoc.py
parenta2253744c9bcd9229be9533540075e977f0be2cd (diff)
parentea2e8f4f107fb50cbb261d4377922ce3814cce32 (diff)
downloadrneovim-2b9fc9a13f1404260448c129762a2679ac688372.tar.gz
rneovim-2b9fc9a13f1404260448c129762a2679ac688372.tar.bz2
rneovim-2b9fc9a13f1404260448c129762a2679ac688372.zip
Merge pull request #8660 from phodge/7688-nvim-buf-lines-should-return-empty-list-for-unloaded-buffer
handle unloaded buffers in nvim_buf_*() functions
Diffstat (limited to 'scripts/gen_api_vimdoc.py')
-rwxr-xr-xscripts/gen_api_vimdoc.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/gen_api_vimdoc.py b/scripts/gen_api_vimdoc.py
index 0bbc3706c6..4e86f15b37 100755
--- a/scripts/gen_api_vimdoc.py
+++ b/scripts/gen_api_vimdoc.py
@@ -413,10 +413,26 @@ def gen_docs(config):
sys.exit(p.returncode)
sections = {}
+ intros = {}
sep = '=' * text_width
base = os.path.join(out_dir, 'xml')
dom = minidom.parse(os.path.join(base, 'index.xml'))
+
+ # generate docs for section intros
+ for compound in dom.getElementsByTagName('compound'):
+ if compound.getAttribute('kind') != 'group':
+ continue
+
+ groupname = get_text(find_first(compound, 'name'))
+ groupxml = os.path.join(base, '%s.xml' % compound.getAttribute('refid'))
+
+ desc = find_first(minidom.parse(groupxml), 'detaileddescription')
+ if desc:
+ doc = parse_parblock(desc)
+ if doc:
+ intros[groupname] = doc
+
for compound in dom.getElementsByTagName('compound'):
if compound.getAttribute('kind') != 'file':
continue
@@ -437,6 +453,11 @@ def gen_docs(config):
name = name.title()
doc = ''
+
+ intro = intros.get('api-%s' % name.lower())
+ if intro:
+ doc += '\n\n' + intro
+
if functions:
doc += '\n\n' + functions