{"id":16926142,"url":"https://github.com/rishichawda/markdown-magic-build-badge","last_synced_at":"2025-09-12T21:35:22.398Z","repository":{"id":33402380,"uuid":"155873006","full_name":"rishichawda/markdown-magic-build-badge","owner":"rishichawda","description":":confetti_ball: A plugin to update your branch badges to point to correct branch status. You can use it in a script or as a git hook or directly from the command line itself!","archived":false,"fork":false,"pushed_at":"2022-12-06T18:55:51.000Z","size":816,"stargazers_count":7,"open_issues_count":14,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-18T22:11:35.806Z","etag":null,"topics":["badges","circleci","codecov","markdown","markdown-magic","travis-ci"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/markdown-magic-branch-badge","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rishichawda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-02T13:54:27.000Z","updated_at":"2022-10-08T21:34:05.000Z","dependencies_parsed_at":"2023-01-15T00:46:16.116Z","dependency_job_id":null,"html_url":"https://github.com/rishichawda/markdown-magic-build-badge","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishichawda%2Fmarkdown-magic-build-badge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishichawda%2Fmarkdown-magic-build-badge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishichawda%2Fmarkdown-magic-build-badge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishichawda%2Fmarkdown-magic-build-badge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rishichawda","download_url":"https://codeload.github.com/rishichawda/markdown-magic-build-badge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245140774,"owners_count":20567447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["badges","circleci","codecov","markdown","markdown-magic","travis-ci"],"created_at":"2024-10-13T20:29:08.977Z","updated_at":"2025-03-23T17:30:51.322Z","avatar_url":"https://github.com/rishichawda.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm package](https://img.shields.io/npm/v/markdown-magic-branch-badge/latest.svg?style=flat-square)](https://www.npmjs.com/package/markdown-magic-branch-badge)\n[![npm downloads](https://img.shields.io/npm/dt/markdown-magic-branch-badge.svg?style=flat-square)](https://www.npmjs.com/package/markdown-magic-branch-badge)\n[![GitHub issues](https://img.shields.io/github/issues/rishichawda/markdown-magic-build-badge.svg?style=flat-square)](https://github.com/rishichawda/markdown-magic-build-badge)\n[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/markdown-magic-branch-badge.svg?style=flat-square)](https://www.npmjs.com/package/markdown-magic-branch-badge)\n![GitHub](https://img.shields.io/github/license/rishichawda/markdown-magic-build-badge.svg?style=flat-square)\n\n![David](https://img.shields.io/david/rishichawda/markdown-magic-build-badge.svg?style=flat-square)\n![David](https://img.shields.io/david/dev/rishichawda/markdown-magic-build-badge.svg?style=flat-square)\n\n## markdown-magic-branch-badge\n\n![demo](https://github.com/rishichawda/markdown-magic-build-badge/blob/master/example/demo.gif)\n\n:star2: A plugin to update your branch badges to point to correct branch status via [markdown-magic](https://github.com/DavidWells/markdown-magic).\n\nSupports all major vendors like [TravisCI](http://travis-ci.org/), [Codecov](https://codecov.io/), [CircleCI](https://circleci.com/) and many more that provide code repository status images and badges for readme files. :tada:\n\n---\n\n### Installation :\n\n```\nnpm i markdown-magic markdown-magic-branch-badge --save-dev\n``` \n### Usage :\n\nCreate a file `update-readme.js` in your project directory.\n\n```\nconst path = require('path');\nconst transformMarkdown = require('markdown-magic');\nconst badgePlugin = require('markdown-magic-branch-badge');\n\nconst config = {\n  transforms: {\n    badgePlugin,\n  },\n};\n\nfunction callback() {\n  console.log('ReadME generated.');\n}\n\nconst markdownPath = path.join(__dirname, 'README.md');\ntransformMarkdown(markdownPath, config, callback);\n```\n\n\u003cbr /\u003eCreate a file, `example-template` with your template.\n\n```\n[![Travis (.org)](https://img.shields.io/travis/user/repo/{current_branch}.svg)](https://travis-ci.org/user/repo)\n[![Some other badge](https://img.shields.io/somebadge/user/repo/{current_branch}.svg)](https://some_badge_url.com/user/repo)\n```\n\nYou can use your custom placeholders through `placeholder` parameter. For the complete list of parameters, see [here](#config-options). \u003cbr/\u003eIf there is no `placeholder` parameter specified in your `README.md` file, the plugin will look for the default placeholder, i.e., `current_branch`.\n\n**NOTE:** Placeholders must be wrapped in curly braces inside the template.\n\n\n\n\n\u003cbr /\u003eOn your `README.md` add the following lines :\n```\n\u003c!-- AUTO-GENERATED-CONTENT:START (badgePlugin:src=./example-template) --\u003e\n\u003c!-- AUTO-GENERATED-CONTENT:END --\u003e\n```\n\nThis indicates the plugin to add the badges between these comments in your readme file.\n\nIf you are using your own placeholder, you can specify it like this :\n\n```\n\u003c!-- AUTO-GENERATED-CONTENT:START (badgePlugin:src=./example-template\u0026placeholder=my_custom_placeholder) --\u003e\n\u003c!-- AUTO-GENERATED-CONTENT:END --\u003e\n```\n\n\n\n\n\u003cbr /\u003eNow, go to the terminal and run:\n\n```\nmarkdown-badge -u ./update-readme.js\n```\n\nAfter running this command, now you should see the updated `README.md` with the badges according to your branch name.\u003cbr/\u003e\n\n---\n\n\n\n### Config options\n\n| Option | Description |\n| ------------- | ------------- |\n| src | Relative path to the template file. ( **Required** )  |\n| addNewLine  | Specify whether to add a new line at the end of the written output. By default, it is set to `false`. |\n| placeholder | Specify a custom placeholder for updating branch names.  |\n\u003cbr /\u003e\n\n---\n\n##### Usage options:\n\nUse it in `pre-commit` and `post-checkout` hooks to keep your branches updated with the correct badge URLs.\n\nTo add a post-checkout hook via command-line, run `markdown-badge -g` in your project root and it will add it to the post-checkout hook to your repository.\n\n\u003cbr /\u003e\n\n\n\nIf you have any queries or requests, feel free to open an issue [here](https://github.com/rishichawda/markdown-magic-build-badge/issues) or open a pull request if you want to contribute! \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishichawda%2Fmarkdown-magic-build-badge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frishichawda%2Fmarkdown-magic-build-badge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishichawda%2Fmarkdown-magic-build-badge/lists"}