@form8ion/remark-inject-badges

remark plugin to inject badges into form8ion conventional zones

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@form8ion/remark-inject-badges
092.0.33 months ago3 years agoMinified + gzip package size for @form8ion/remark-inject-badges in KB

Readme

remark-inject-badges
remark plugin to inject badges into form8ion conventional zones

!Node CI Workflow Statusgithub-actions-ci-badgegithub-actions-ci-link

Table of Contents

Installation Example
* [Import](#import)
* [Execute](#execute)
Dependencies Verification

Usage


!MIT licenselicense-badgelicense-link !npmnpm-badgenpm-link !Try @form8ion/remark-inject-badges on RunKitrunkit-badgerunkit-link !nodenode-badge

Installation

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

Example

Import

import fs from 'fs';
import remark from 'remark';
import injectBadges from '@form8ion/remark-inject-badges';

Execute

remark()
  .use(
    injectBadges,
    {
      contribution: {
        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.contents);
    }
  );

Contributing


!PRs WelcomePRs-badgePRs-link !Conventional Commitscommit-convention-badgecommit-convention-link !Commitizen friendlycommitizen-badgecommitizen-link !semantic-releasesemantic-release-badgesemantic-release-link !Renovaterenovate-badgerenovate-link

Dependencies

$ nvm install
$ npm install

Verification

$ npm test