mirror of
https://github.com/all-contributors/cli.git
synced 2025-01-09 13:36:29 +00:00
Added necessary lines to produce the accurate reference to the specs (#16)
This commit is contained in:
parent
dfc20fc8d9
commit
8f2f9dd025
2 changed files with 17 additions and 3 deletions
|
@ -37,7 +37,11 @@ test('should create contributors section if it is absent', t => {
|
|||
'Description',
|
||||
'## Contributors',
|
||||
'',
|
||||
'<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --><!-- ALL-CONTRIBUTORS-LIST:END -->'
|
||||
'Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):',
|
||||
'',
|
||||
'<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --><!-- ALL-CONTRIBUTORS-LIST:END -->',
|
||||
'',
|
||||
'This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!'
|
||||
].join('\n');
|
||||
|
||||
const result = addContributorsList(content);
|
||||
|
@ -51,7 +55,11 @@ test('should create contributors section if content is empty', t => {
|
|||
'',
|
||||
'## Contributors',
|
||||
'',
|
||||
'<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --><!-- ALL-CONTRIBUTORS-LIST:END -->'
|
||||
'Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):',
|
||||
'',
|
||||
'<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --><!-- ALL-CONTRIBUTORS-LIST:END -->',
|
||||
'',
|
||||
'This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!'
|
||||
].join('\n');
|
||||
|
||||
const result = addContributorsList(content);
|
||||
|
|
|
@ -4,7 +4,9 @@ var _ = require('lodash/fp');
|
|||
var injectContentBetween = require('../util').markdown.injectContentBetween;
|
||||
|
||||
var badgeContent = '[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors)';
|
||||
var headerContent = 'Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):';
|
||||
var listContent = '<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --><!-- ALL-CONTRIBUTORS-LIST:END -->';
|
||||
var footerContent = 'This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!';
|
||||
|
||||
function addBadge(lines) {
|
||||
return injectContentBetween(lines, badgeContent, 1, 1);
|
||||
|
@ -31,7 +33,11 @@ function addContributorsList(lines) {
|
|||
.concat([
|
||||
'## Contributors',
|
||||
'',
|
||||
listContent
|
||||
headerContent,
|
||||
'',
|
||||
listContent,
|
||||
'',
|
||||
footerContent
|
||||
]);
|
||||
}
|
||||
return injectContentBetween(lines, listContent, insertionLine + 2, insertionLine + 2);
|
||||
|
|
Loading…
Reference in a new issue