Skip to content

Commit 31a27ca

Browse files
committed
proper markdown formatting of the table
1 parent 4f620cb commit 31a27ca

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Diff for: internal/readme-chapters.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,23 @@ async function run(argv) {
5353

5454
await createImages(postData);
5555

56-
const rows = chunk(postData, 5).map(
57-
chunk =>
58-
"| " +
59-
chunk
60-
.map(
61-
postData =>
62-
`<a href='${postData.folder}'><img src='${
63-
postData.folder
64-
}/cover.jpg' width='140px;' /></a><h4 align='center'><a href='${
65-
postData.folder
66-
}'>${postData.title}</a><h4>`
67-
)
68-
.join(" | ") +
69-
" |"
56+
const items = postData.map(
57+
postData =>
58+
`<a href='${postData.folder}'><img src='${
59+
postData.folder
60+
}/cover.jpg' width='140px;' /></a><h4 align='center'><a href='${
61+
postData.folder
62+
}'>${postData.title}</a><h4>`
7063
);
64+
65+
const rows = chunk(items, 5).map(chunk => `| ` + chunk.join(" | ") + ` |`);
66+
7167
let output =
72-
rows.join("\n") + "\n" + "| :---: | :---: | :---: | :---: | :---: |";
68+
rows[0] +
69+
"\n" +
70+
"| :---: | :---: | :---: | :---: | :---: |\n" +
71+
rows.slice(1).join("\n");
72+
7373
console.log(output);
7474
}
7575

0 commit comments

Comments
 (0)