awesome-neovim
awesome-neovim copied to clipboard
Generate standalone `TAGS.md`
The current categories are great, and I'd like to enhance it by generating a standalone TAGS.md file to help users navigate the plugins.
Proof of concept (Python script):
import re
import requests
idx = 0;
with open("TAGS.md", mode="w") as target:
with open("README.md", mode="r+") as f:
for line in f.readlines():
if idx == 5:
break
if line == "## External":
break
if line[0] == "-" and "github.com" in line:
github_url = re.search("(?P<url>https?://github.com[^\s)#]+)", line).group("url")
user = github_url.split("/")[3]
repo = github_url.split("/")[4]
target_api_url = f"https://api.github.com/repos/{user}/{repo}"
req = requests.get(target_api_url, headers={"Accept": "application/vnd.github.mercy-preview+json"})
topic_list = req.json()["topics"]
if len(topic_list):
target.write(line)
for topic in topic_list:
target.write(f" [#{topic}](https://github.com/topics/{topic})")
target.write(".\n")
idx += 1
Proof of concept (generated TAGS.md file)
Nice idea but I don't think this will add much, everything will just be#lua, #neovim, #neovim-plugin etc.
I can add a few lines to filter out those generic tags.
It’s up to the maintainers, so feel free to close this issue.
That's true, if you can also make it a GitHub action that automatically adds it when a new line is added to a PR I'm fine with it.
Got it. I'll start working on the GitHub Actions part.
@3719e04 Any progress on this or should I close this issue?