remark plugin to inject badges into form8ion conventional zones
$ npm install @form8ion/remark-inject-badges --save-dev
import fs from 'node:fs';
import {remark} from 'remark';
import injectBadges from '@form8ion/remark-inject-badges';
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}`);
}
);
$ nvm install
$ npm install
$ npm test