update-scripts: Extract the list of all servers from nvim-lspconfig

This commit is contained in:
Quentin Boyer 2024-09-29 19:04:07 +02:00
parent cab6b0c9fe
commit aa24b3f9d8
8 changed files with 1832 additions and 1 deletions

View file

@ -0,0 +1,23 @@
#!/usr/bin/env python3
import json
import os
import subprocess
import sys
filter = os.environ.get("LUA_FILTER")
if filter is None:
filter = os.path.dirname(__file__) + "/desc-filter.lua"
with open(sys.argv[1]) as f:
data = json.load(f)
for d in data:
if "desc" in d:
if "#" in d["desc"]:
d["desc"] = subprocess.run(
["pandoc", "-t", "markdown", f"--lua-filter={filter}"],
input=d["desc"],
capture_output=True,
text=True,
).stdout
print(json.dumps(data, sort_keys=True))