This Go program reads a Markdown file containing GitHub repository links and updates the links with information about star counts.
The initial part of the markdown file:
- APITree - A tool for managing and sharing API specifications, with version control, API testing automation, and integration with popular API tools.
- DapperDox - An open-source API documentation generator and server for OpenAPI/Swagger specifications, with customizable documentation, automated updates, and easy sharing.
- OpenAPI Explorer - A tool for generating user interfaces from OpenAPI specifications, making it easier for software engineers to visualize and interact with APIs.
- RapiDoc - A tool that generates customizable, interactive API documentation from OpenAPI Specification, with a range of design options.
- Redoc - An open-source tool for generating documentation from OpenAPI (fka Swagger) definitions, with customizable themes, language support, and branding.
After processing:
- APITree - A tool for managing and sharing API specifications, with version control, API testing automation, and integration with popular API tools.
- DapperDox (⭐377) - An open-source API documentation generator and server for OpenAPI/Swagger specifications, with customizable documentation, automated updates, and easy sharing.
- OpenAPI Explorer (⭐213) - A tool for generating user interfaces from OpenAPI specifications, making it easier for software engineers to visualize and interact with APIs.
- RapiDoc (⭐1.3k) - A tool that generates customizable, interactive API documentation from OpenAPI Specification, with a range of design options.
- Redoc (⭐20k) - An open-source tool for generating documentation from OpenAPI (fka Swagger) definitions, with customizable themes, language support, and branding.
The program updates GitHub links in a Markdown file with their current star counts.
You must provide a GitHub token via the GITHUB_TOKEN
environment variable. The value should be a personal access token with read-only permissions.
GitHub rate limits apply when fetching repository information.
- Clone the repository:
git clone https://github.com/stn1slv/markdown-github-stars-updater.git
cd markdown-github-stars-updater
- Build and run the program:
go build
./markdown-github-stars-updater [flags] path/to/your/markdown/file.md
Replace path/to/your/markdown/file.md with the path to your Markdown file. Available flags:
-out
– write output to the specified file instead of overwriting the input.-dry-run
– print the updated Markdown to stdout without modifying any files.
Run the tool separately for each Markdown file you want to update. The current implementation relies on a regular expression to find github.com
links, so unusual Markdown constructs may not be detected.
The last compiled version is available in the releases section.
Please see the pipeline example for my awesome-integration project.
This program utilizes the GitHub API to fetch star counts for GitHub repositories and updates the links in the provided Markdown file. It supports different star count formats based on the number of stars:
- If the star count is less than 1000, the exact star count is shown (e.g., "⭐35").
- If the star count is between 1000 and 9999, it is displayed in the format "⭐1.1k" for 1100 stars.
- If the star count is 10000 or more, it is displayed in the format "⭐10k" for 10000 stars.
- Go programming language (https://golang.org/dl/)
Set the GITHUB_TOKEN
environment variable with a personal access token so the tool can query the GitHub API. The requests are subject to GitHub's rate limits.
This project is licensed under the MIT License. See LICENSE for more information.
Special thanks to the GitHub community and open-source contributors.