@form8ion/remark-inject-badges
v3.2.1
Published
remark plugin to inject badges into form8ion conventional zones
Downloads
3,327
Readme
remark-inject-badges
remark plugin to inject badges into form8ion conventional zones
Table of Contents
Usage
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
Dependencies
$ nvm install
$ npm install
Verification
$ npm test