Former-commit-id: ab65fe342b
This commit is contained in:
Hadi
2024-10-07 10:13:21 +02:00
parent 18c30e5931
commit a33cf73ff1
75 changed files with 132 additions and 471 deletions

View File

@@ -6,22 +6,15 @@
README_FILE="./README.md"
header=$(cat "./docs/src/header.md")
table_of_content=$(md-table-of-contents ./docs/src/README_template.md) # https://github.com/anotherhadi/md-table-of-contents
version=$(git describe --tags --abbrev=0)
readme_content=$(cat "./docs/src/README_template.md")
description=$(curl -s https://api.github.com/repos/anotherhadi/nixy | jq .description)
description="${description%\"}"
description="${description#\"}"
header=${header//\{date\}/$(date '+%D')}
header=${header//\{primarycolor\}/89b4fa}
header=${header//\{backgroundcolor\}/181825}
header=${header//\{version\}/$version}
header=${header//\{description\}/$description}
# Replace variables
readme_content=${readme_content//\{primarycolor\}/89b4fa}
readme_content=${readme_content//\{backgroundcolor\}/181825}
readme_content=${readme_content//\{md_table_of_content\}/$table_of_content}
echo "$header" >"$README_FILE"
echo "[//]: # (This file is autogenerated)" >"$README_FILE"
echo "$readme_content" >>"$README_FILE"
sed 's/\r//' "$README_FILE" >"/tmp/readme.md"
mv "/tmp/readme.md" "$README_FILE"