Enable automatic README generation (#132)

This commit is contained in:
Abe Pazos
2020-07-10 17:42:59 +02:00
committed by GitHub
parent 2a7f837b55
commit a582d6550a
4 changed files with 16 additions and 4 deletions

View File

@@ -129,7 +129,13 @@ task buildMainReadme {
for (line in header) {
newReadme.add(line)
}
newReadme.add("| name" + (" ".repeat(36)) + " | description |")
newReadme.add("| name" +
"      " +
"      " +
"      " +
"      " +
"      " +
"      " + " | description |")
newReadme.add("| --- | --- |")
// Search for the description at the top of the readme.
@@ -146,7 +152,7 @@ task buildMainReadme {
def orxReadmeText = orxReadmeFile.getText()
orxReadmeText.find(descriptionRx) {
description ->
def trimmedDescription = description[1].strip()
def trimmedDescription = description[1].trim() //.strip() supports unicode, java11 only
.replace("\n", " ").replace("\r", "")
newReadme.add("| [`${sub.name}`](${sub.name}/README.md) " +
"| $trimmedDescription |")