Add flair

This commit is contained in:
Zach Borboa
2024-08-24 13:22:18 -04:00
parent db6f650c47
commit bbcbb72c9e
2 changed files with 20 additions and 19 deletions
+3 -3
View File
@@ -4,11 +4,11 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${SCRIPT_DIR}/.."
before=$(head -n $(
grep --context="0" --line-number --max-count="1" "### Available Methods" "README.md" |
grep --context="0" --line-number --max-count="1" "### 📖 Available Methods" "README.md" |
perl -pe 's/^(\d+):.*/\1/') "README.md")
after=$(tail -n +$(
grep --context="0" --line-number --max-count="1" "### Security" "README.md" |
grep --context="0" --line-number --max-count="1" "### 🔒 Security" "README.md" |
perl -pe 's/^(\d+):.*/\1/') "README.md")
echo "${before}" > "README.md"
@@ -48,7 +48,7 @@ echo "${after}" >> "README.md"
# Update table of contents.
script=$(cat <<'EOF'
$data = file_get_contents('README.md');
preg_match_all('/^### ([\w ]+)/m', $data, $matches);
preg_match_all('/^### (.*)/m', $data, $matches);
$toc = [];
foreach ($matches['1'] as $match) {
$href = '#' . str_replace(' ', '-', strtolower($match));