Skip to content

remark plugin to inject badges into form8ion conventional zones

License

Notifications You must be signed in to change notification settings

form8ion/remark-inject-badges

Repository files navigation

remark-inject-badges

remark plugin to inject badges into form8ion conventional zones

Node CI Workflow Status

Table of Contents

Usage

MIT license npm Try @form8ion/remark-inject-badges on RunKit node

Installation

$ npm install @form8ion/remark-inject-badges --save-dev

Example

Import

import fs from 'node:fs';
import {remark} from 'remark';
import injectBadges from '@form8ion/remark-inject-badges';

Execute

remark()
  .use(
    injectBadges,
    {
      contribution: {
        badgeKey: {
          text: 'alt-text for the badge image',
          link: 'url for badge link',
          img: 'badge image url'
        }
      }
    }
  )
  .process(
    `# project-name

<!--status-badges start -->
<!--status-badges end -->

<!--consumer-badges start -->
<!--consumer-badges end -->

<!--contribution-badges start -->
<!--contribution-badges end -->
`,
    (err, file) => {
      fs.writeFileSync(`${process.cwd()}/README.md`, `${file}`);
    }
  );

Contributing

PRs Welcome Conventional Commits Commitizen friendly semantic-release Renovate

Dependencies

$ nvm install
$ npm install

Verification

$ npm test