Skip to content

Latest commit

 

History

History
145 lines (98 loc) · 6.69 KB

README.md

File metadata and controls

145 lines (98 loc) · 6.69 KB

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