This commit is contained in:
Miloslav Ciz 2024-03-20 20:23:58 +01:00
parent dba7dfe7d0
commit 950ac93987
18 changed files with 1844 additions and 1765 deletions

View file

@ -37,5 +37,43 @@ git log --name-only | head -n 50 | grep "Date:\|.*\.md" | sed "s/\([^ ]*\.md\)/
printf "\`\`\`\n" >> $FILE_NAME
printf "\nmost wanted pages:\n\n" >> $FILE_NAME
./most_wanted.sh >> $FILE_NAME
cat ./*.md | sed -n 's/.*\[.*\](\([^\)\(]*\)).*/\1/p' | sort | uniq -c | sort -nr > tmp.txt
rm tmp2.txt
touch tmp2.txt
while read -r line; do
fname=`echo "$line" | grep -o "[^ ]*\.md" -`
if ! [ -f $fname ]; then
printf -- "- [" >> tmp2.txt
printf $fname | sed "s/^\([^ ]*\)\.md/\1](${fname}) (/g" >> tmp2.txt
echo $line | sed "s/^ *\([0-9]*\).*$/\1)/g" >> tmp2.txt
fi
done < tmp.txt
cat tmp2.txt | head -n 20 >> $FILE_NAME
rm tmp.txt tmp2.txt
printf "\nmost popular and lonely pages:\n\n" >> $FILE_NAME
rm tmp.txt
touch tmp.txt
for fname in *.md; do
count=`grep -F -o "($fname)" *.md | wc -l`
echo "$count $fname" >> tmp.txt
done
rm tmp2.txt
cat tmp.txt | sort -n -r | head -n 30 > tmp2.txt
echo "- ..." >> tmp2.txt
cat tmp.txt | sort -n -r | tail -n 30 >> tmp2.txt
cat tmp2.txt | sed "s/ *\([^ ]*\) \+\([^ ]*\)\.md/- [\2](\2.md) (\1) /g" >> $FILE_NAME
rm tmp2.txt
rm tmp.txt
printf "\n" >> $FILE_NAME