Rotate reports back to landscape, page per month

parent 7a9cc386
......@@ -96,9 +96,9 @@ reports/%.pdf: reports/%.md
-t latex \
--pdf-engine=xelatex \
-V "documentclass:scrreprt" \
-V "geometry:landscape" \
-V "geometry:hmargin=2cm" \
-V "geometry:vmargin=3cm" \
-V "geometry:top=2cm" \
-V "geometry:bottom=3cm" \
-V "pagestyle:headings" \
-V "mainfont:Libertinus Serif" \
-V "sansfont:Libertinus Sans" \
......
......@@ -64,28 +64,40 @@ reports/translations-worklog.md: combined-worklogs.sqlite combined-daylog.sqlite
export IFS='|'
sqlite3 $< "SELECT DISTINCT(author) FROM commits" |
while read author; do
echo "\n# $${author} Worklog"
echo "Report Generated\n: $${now}\n"
echo "Repository Version\n: $${ver}\n"
sqlite3 $< "SELECT DISTINCT strftime('%Y-%m', date) FROM commits WHERE author='$${author}'" |
while read month; do
echo "\n## $$(LANG=en_US date +'%B %Y' -d $${month}-01)"
sqlite3 combined-worklogs.sqlite "SELECT SUM(added+ -removed) FROM commits WHERE author='$${author}' and strftime('%Y-%m', date)='$${month}'" | read netadded
sqlite3 combined-daylog.sqlite "SELECT COUNT(DISTINCT(date)) AS Days FROM days WHERE author='$${author}' AND strftime('%Y-%m', date)='$${month}' AND apr != '' AND hours >= 1" | read days
[[ $${netadded} -ge 1 ]] || continue
echo "# Worklog for $${author}"
echo "## $$(LANG=en_US date +'%B %Y' -d $${month}-01)"
echo
echo "Report Generated on $${now} from repository $${ver}."
echo
echo "### File edits"
echo
echo "Net Characters Added: $${netadded}"
echo
echo '``` table'
echo '---\nheader: True\n---'
sqlite3 --header -csv $< "SELECT file as Filename, SUM(added) AS Added, SUM(-removed) AS Removed FROM commits WHERE author='$${author}' AND strftime('%Y-%m', date)='$${month}' GROUP BY Filename"
sqlite3 --header -csv combined-worklogs.sqlite "SELECT file as Filename, SUM(added) AS Added, SUM(-removed) AS Removed FROM commits WHERE author='$${author}' AND strftime('%Y-%m', date)='$${month}' GROUP BY Filename"
echo '```'
echo -n "Net Characters Added\n: "
sqlite3 $< "SELECT SUM(added+ -removed) FROM commits WHERE author='$${author}' and strftime('%Y-%m', date)='$${month}'"
echo '\n``` table'
echo '---\nheader: True\n---'
sqlite3 --header -csv combined-daylog.sqlite "SELECT date AS Date, SUM(hours) AS Hours FROM days WHERE author='$${author}' AND strftime('%Y-%m', date)='$${month}' AND apr != '' AND Hours >= 1 GROUP BY date"
echo '```'
echo -n "Days spent at office\n: "
sqlite3 combined-daylog.sqlite "SELECT COUNT(DISTINCT(date)) AS Days FROM days WHERE author='$${author}' AND strftime('%Y-%m', date)='$${month}' AND apr != '' AND hours >= 1"
echo
if [[ $${days} -ge 0 ]]; then
echo "### Office Days"
echo
echo "Days spent at office: $${days}"
echo
echo '``` table'
echo '---\nheader: True\n---'
sqlite3 --header -csv combined-daylog.sqlite "SELECT date AS Date, SUM(hours) AS Hours FROM days WHERE author='$${author}' AND strftime('%Y-%m', date)='$${month}' AND apr != '' AND Hours >= 1 GROUP BY date"
echo '```'
echo
fi
echo
done
done |
$(PANDOC) $(PANDOCARGS) -F pantable -o $@
$(PANDOC) $(PANDOCARGS) -F pantable -o $@
reports/progress.md: $(CCMTOOLKITDIR)/languages.yml $$(newcommits)
mkdir -p $(dir $@)
......
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