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.
* [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)

25
gen-readme.ts

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

Loading…
Cancel
Save