Skip to content

Commit

Permalink
fix name and description
Browse files Browse the repository at this point in the history
  • Loading branch information
cqb13 committed Jul 23, 2024
1 parent 394a452 commit 1c7f3c1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions loadPrograms.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ const loadPrograms = async () => {
txt_file_url = file.html_url;
} else if (file.name === "about.md") {
const aboutResponse = await fetch(file.download_url);

const aboutText = await aboutResponse.text();

const aboutLines = aboutText.split("\n");

let descriptionLines = [];
let descriptionStarted = false;
for (const line of aboutLines) {
if (line.startsWith("# ")) {
name = line.substring(2);
descriptionStarted = true;
continue;
}

if (line.startsWith("#")) {
descriptionStarted = false;
}

if (descriptionStarted && line != "") {
descriptionLines.push(line);
}
}

description = descriptionLines.join(" ");
}
}

Expand Down

0 comments on commit 1c7f3c1

Please sign in to comment.