aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_vimdoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gen_vimdoc.py')
-rwxr-xr-xscripts/gen_vimdoc.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py
index 8e1d6ef80a..b8c36dc35d 100755
--- a/scripts/gen_vimdoc.py
+++ b/scripts/gen_vimdoc.py
@@ -42,6 +42,7 @@ import subprocess
import collections
import msgpack
import logging
+from pathlib import Path
from xml.dom import minidom
@@ -55,19 +56,19 @@ if sys.version_info < MIN_PYTHON_VERSION:
doxygen_version = tuple((int(i) for i in subprocess.check_output(["doxygen", "-v"],
universal_newlines=True).split()[0].split('.')))
-# Until 0.9 is released, need this hacky way to check that "nvim -l foo.lua" works.
-nvim_version = list(line for line in subprocess.check_output(['nvim', '-h'], universal_newlines=True).split('\n')
- if '-l ' in line)
-
if doxygen_version < MIN_DOXYGEN_VERSION:
print("\nRequires doxygen {}.{}.{}+".format(*MIN_DOXYGEN_VERSION))
print("Your doxygen version is {}.{}.{}\n".format(*doxygen_version))
sys.exit(1)
-if len(nvim_version) == 0:
- print("\nRequires 'nvim -l' feature, see https://github.com/neovim/neovim/pull/18706")
+
+# Need a `nvim` that supports `-l`, so use the local build
+nvim = Path(__file__).parent / "../build/bin/nvim"
+if not nvim.exists():
+ print("\nYou need to build Neovim first to build the documentation.")
sys.exit(1)
+
# DEBUG = ('DEBUG' in os.environ)
INCLUDE_C_DECL = ('INCLUDE_C_DECL' in os.environ)
INCLUDE_DEPRECATED = ('INCLUDE_DEPRECATED' in os.environ)
@@ -1163,7 +1164,7 @@ def main(doxygen_config, args):
def filter_source(filename):
name, extension = os.path.splitext(filename)
if extension == '.lua':
- p = subprocess.run(['nvim', '-l', lua2dox, filename], stdout=subprocess.PIPE)
+ p = subprocess.run([str(nvim), '-l', lua2dox, filename], stdout=subprocess.PIPE)
op = ('?' if 0 != p.returncode else p.stdout.decode('utf-8'))
print(op)
else: