From 68166eca69d1d6e5685aa956d11240b87c7cbca0 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Tue, 11 Jun 2019 11:17:51 -0400 Subject: [PATCH] feat: Pretty-print the generagted HTML table (#190) Closes #189 Keeps the Table left aligned, and moves the tr and td in by 2 spaces each --- .../__tests__/__snapshots__/index.js.snap | 22 +++++++++++++++++-- src/generate/index.js | 8 ++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/generate/__tests__/__snapshots__/index.js.snap b/src/generate/__tests__/__snapshots__/index.js.snap index 860d71f5..74d677a1 100644 --- a/src/generate/__tests__/__snapshots__/index.js.snap +++ b/src/generate/__tests__/__snapshots__/index.js.snap @@ -9,7 +9,13 @@ Description These people contributed to the project: -
Kent C. Dodds is awesome!Divjot Singh is awesome!Jeroen Engels is awesome!
+ + + + + + +
Kent C. Dodds is awesome!Divjot Singh is awesome!Jeroen Engels is awesome!
@@ -25,7 +31,19 @@ Description These people contributed to the project: -
Kent C. Dodds is awesome!Kent C. Dodds is awesome!Kent C. Dodds is awesome!Kent C. Dodds is awesome!Kent C. Dodds is awesome!
Kent C. Dodds is awesome!Kent C. Dodds is awesome!
+ + + + + + + + + + + + +
Kent C. Dodds is awesome!Kent C. Dodds is awesome!Kent C. Dodds is awesome!Kent C. Dodds is awesome!Kent C. Dodds is awesome!
Kent C. Dodds is awesome!Kent C. Dodds is awesome!
diff --git a/src/generate/index.js b/src/generate/index.js index d6d1b3c8..5fd0b9a4 100644 --- a/src/generate/index.js +++ b/src/generate/index.js @@ -36,7 +36,9 @@ function injectListBetweenTags(newContent) { } function formatLine(contributors) { - return `${contributors.join('')}` + return `${contributors.join( + '\n ', + )}` } function generateContributorsList(options, contributors) { @@ -46,9 +48,9 @@ function generateContributorsList(options, contributors) { }), _.chunk(options.contributorsPerLine), _.map(formatLine), - _.join(''), + _.join('\n \n \n '), newContent => { - return `\n${newContent}
\n\n` + return `\n\n \n ${newContent}\n \n
\n\n` }, )(contributors) }