Unverified Commit bac28b24 authored by Caleb Maclennan's avatar Caleb Maclennan
Browse files

Automate reports based on detected languages

parent c5a2b6b0
......@@ -70,20 +70,21 @@ $(CCMTOOLKITDIR)/language-%.yml:
.PHONY: stats
stats: reports/progress.pdf
reports/progress.md: $(shell git ls-files -- '*.md') force
reports/progress.md: $(shell git ls-files -- '*.md') $(CCMTOOLKITDIR)/languages.yml force
mkdir -p $(dir $@)
export PS4=; exec > $@ # black magic
echo ---
echo title: Stats for $(call versioninfo,$(PROJECT))
echo date: $(shell LANG=en date)
echo date: $(shell LANG=$(LANGUAGE) date)
echo ---
echo "# English"
echo
$(foreach EN,$(filter en/%,$^),echo "## \`$(EN)\`\n $(shell perl -pne 's/\s//g' < $(EN) | wc -c) char\n";)
echo
echo "# Türkçe"
echo
$(foreach TR,$(filter tr/%,$^),echo "## \`$(TR)\`\n $(shell perl -pne 's/\s//g' < $(TR) | wc -c) char\n";)
for lang in $(TRANSLATIONS); do
yq -M -e -r ".$${lang}" < $(filter %/languages.yml,$^) | read langname
echo "# $${langname}\n"
for file in $$(git ls-files -- $${lang}/*.md); do
echo "* \`$${file}\`: $$(perl -pne 's/\s//g' $${file} | wc -c ) $(_characters)"
done
echo
done
reports/%.pdf: reports/%.md
$(PANDOC) $< -t latex -o $@
......
......@@ -3,3 +3,5 @@ _course := course
_book := book
_manuscript := manuscript
_studyguide := studyguide
_characters := characters
_words := words
_lesson := ders
_course := kurs
_book := kitap
_book := kitap
_manuscript := yazi
_studyguide := calismarehberi
_characters := karakter
_words := kelime
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment