awesome-neovim icon indicating copy to clipboard operation
awesome-neovim copied to clipboard

Generate standalone `TAGS.md`

Open 3719e04 opened this issue 2 years ago • 4 comments

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) TAGS_md

3719e04 avatar Jul 28 '23 20:07 3719e04

Nice idea but I don't think this will add much, everything will just be#lua, #neovim, #neovim-plugin etc.

tversteeg avatar Jul 29 '23 07:07 tversteeg

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.

3719e04 avatar Jul 29 '23 07:07 3719e04

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.

tversteeg avatar Jul 29 '23 16:07 tversteeg

Got it. I'll start working on the GitHub Actions part.

3719e04 avatar Jul 29 '23 18:07 3719e04

@3719e04 Any progress on this or should I close this issue?

tversteeg avatar Feb 12 '24 15:02 tversteeg