Browse Source

gen-readme: fix no NL before screenshots w/o demo

pull/32/head
D. Bohdan 1 year ago
parent
commit
e3bd4df31d
  1. 1
      README.md
  2. 25
      gen-readme.ts

1
README.md

@ -410,6 +410,7 @@ These are frameworks that do not force you to apply their classes to many elemen
A class-light variant of a CSS framework with classes. Made for Ruby on Rails. A class-light variant of a CSS framework with classes. Made for Ruby on Rails.
* [Repository](https://github.com/lazaronixon/sass-zero) ![GitHub stars](https://img.shields.io/github/stars/lazaronixon/sass-zero?style=flat-square) ![GitHub contributors](https://img.shields.io/github/contributors-anon/lazaronixon/sass-zero?style=flat-square) ![Last commit](https://img.shields.io/github/last-commit/lazaronixon/sass-zero?style=flat-square) ![GitHub open issues](https://img.shields.io/github/issues-raw/lazaronixon/sass-zero?style=flat-square) ![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/lazaronixon/sass-zero?style=flat-square) * [Repository](https://github.com/lazaronixon/sass-zero) ![GitHub stars](https://img.shields.io/github/stars/lazaronixon/sass-zero?style=flat-square) ![GitHub contributors](https://img.shields.io/github/contributors-anon/lazaronixon/sass-zero?style=flat-square) ![Last commit](https://img.shields.io/github/last-commit/lazaronixon/sass-zero?style=flat-square) ![GitHub open issues](https://img.shields.io/github/issues-raw/lazaronixon/sass-zero?style=flat-square) ![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/lazaronixon/sass-zero?style=flat-square)
[![sass-zero.png](thumbnail/sass-zero.png)](screenshot/sass-zero.png) [![sass-zero.png](thumbnail/sass-zero.png)](screenshot/sass-zero.png)

25
gen-readme.ts

@ -39,18 +39,25 @@ const renderItem = (
`[![${filename}](thumbnail/${filename})](screenshot/${filename})` `[![${filename}](thumbnail/${filename})](screenshot/${filename})`
).join("\n"); ).join("\n");
return `### ${name}\n\n` + const lines: string[] = [];
(note === "" ? "" : `${note}\n\n`) + lines.push(`### ${name}`, "");
(website === "" ? "" : `* [Website](${website})\n`) + if (note !== "") {
(github === "" lines.push(note, "");
? "" }
: `* [Repository](https://github.com/${github}) ![GitHub stars](https://img.shields.io/github/stars/${github}?style=flat-square) ` + if (website !== "") lines.push(`* [Website](${website})`);
if (github !== "") {
lines.push(
`* [Repository](https://github.com/${github}) ![GitHub stars](https://img.shields.io/github/stars/${github}?style=flat-square) ` +
`![GitHub contributors](https://img.shields.io/github/contributors-anon/${github}?style=flat-square) ` + `![GitHub contributors](https://img.shields.io/github/contributors-anon/${github}?style=flat-square) ` +
`![Last commit](https://img.shields.io/github/last-commit/${github}?style=flat-square) ` + `![Last commit](https://img.shields.io/github/last-commit/${github}?style=flat-square) ` +
`![GitHub open issues](https://img.shields.io/github/issues-raw/${github}?style=flat-square) ` + `![GitHub open issues](https://img.shields.io/github/issues-raw/${github}?style=flat-square) ` +
`![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/${github}?style=flat-square)\n`) + `![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/${github}?style=flat-square)`,
(demo === "" ? "" : `* [Demo](${demo})\n\n`) + );
screenshotMarkdown; }
if (demo !== "") lines.push(`* [Demo](${demo})`);
lines.push("", screenshotMarkdown);
return lines.join("\n");
}; };
try { try {

Loading…
Cancel
Save