sfizz/doxygen/scripts/generate_api_index.sh
2020-04-06 14:19:55 +02:00

19 lines
454 B
Bash
Executable file

#!/bin/bash
# Must be called from the root directory
if [[ -f api_index.md ]]; then rm api_index.md; fi
cat >>api_index.md <<EOF
---
title: "API"
---
EOF
tags=()
for tag in $(git tag --list); do
if [[ ${tag} != "list" && ${tag} != *"test"* ]]; then
tag=$(echo "${tag}" | sed -r 's/v//g')
tags+=("${tag}")
fi
done
IFS=$'\n' tags=($(sort <<<"${tags[*]}")); unset IFS
for tag in "${tags[@]}"; do
echo "- [${tag}](${tag})" >> api_index.md
done