nix-community.nixvim/ci/nvim-lspconfig/clean-desc.py
Matt Sturgeon 2b2b1e6d8f ci: rename update-scriptsci
This changes how we think about this directory; it does not need to be
exclusively for scripts related to updates, but should be a place for
any scripts intended to be run by CI workflows.

This mindset should make it easier to develop and test the business
logic of workflows, without always needing to test "in production" on
the nixvim repo or a fork.
2025-06-15 21:23:58 +00:00

23 lines
621 B
Python
Executable file

#!/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))