[GH-ISSUE #829] Generate standalone TAGS.md #39181

Closed
opened 2026-06-08 06:04:28 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @3719e04 on GitHub (Jul 28, 2023).
Original GitHub issue: https://github.com/rockerBOO/awesome-neovim/issues/829

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

Originally created by @3719e04 on GitHub (Jul 28, 2023). Original GitHub issue: https://github.com/rockerBOO/awesome-neovim/issues/829 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): ```python 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) <img width="863" alt="TAGS_md" src="https://github.com/rockerBOO/awesome-neovim/assets/56977205/2a6552ba-1a9b-48b5-9a94-e38a0360192e">
Author
Owner

@tversteeg commented on GitHub (Jul 29, 2023):

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

<!-- gh-comment-id:1656586687 --> @tversteeg commented on GitHub (Jul 29, 2023): Nice idea but I don't think this will add much, everything will just be`#lua`, `#neovim`, `#neovim-plugin` etc.
Author
Owner

@3719e04 commented on GitHub (Jul 29, 2023):

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.

<!-- gh-comment-id:1656587160 --> @3719e04 commented on GitHub (Jul 29, 2023): 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.
Author
Owner

@tversteeg commented on GitHub (Jul 29, 2023):

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.

<!-- gh-comment-id:1656786480 --> @tversteeg commented on GitHub (Jul 29, 2023): 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.
Author
Owner

@3719e04 commented on GitHub (Jul 29, 2023):

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

<!-- gh-comment-id:1656810250 --> @3719e04 commented on GitHub (Jul 29, 2023): Got it. I'll start working on the GitHub Actions part.
Author
Owner

@tversteeg commented on GitHub (Feb 12, 2024):

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

<!-- gh-comment-id:1938871235 --> @tversteeg commented on GitHub (Feb 12, 2024): @3719e04 Any progress on this or should I close this issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/awesome-neovim#39181