Tweak table formatting in reports

parent 7933b39a
......@@ -117,6 +117,7 @@ reports/%.pdf: reports/%.md
-V "pagestyle:headings" \
-V "mainfont:Libertinus Serif" \
-V "sansfont:Libertinus Sans" \
-V "monofont:Hack" \
$< -o $@
reports/worklog.md: repository-worklog.md
......
......@@ -62,6 +62,16 @@ reports/translations-worklog.md: combined-worklogs.sqlite combined-daylog.sqlite
now=$$(LANG=en_US date +%c)
ver=$(call versioninfo,$(PROJECT))
export IFS='|'
(
echo ---
echo title: Translations Worklog
echo subtitle: An automated report generated from $${ver}.
echo date: $${now}
echo header-includes:
echo -E ' - \setlength\LTleft{0pt}'
echo -E ' - \setlength\LTright{0pt}'
echo -E ' - \setlength\parindent{0pt}'
echo ---
sqlite3 $< "SELECT DISTINCT(author) as Author FROM commits ORDER BY Author" |
while read author; do
sqlite3 $< "SELECT DISTINCT strftime('%Y-%m', date) AS Month FROM commits WHERE author='$${author}' ORDER BY Month" |
......@@ -72,14 +82,12 @@ reports/translations-worklog.md: combined-worklogs.sqlite combined-daylog.sqlite
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---'
echo '```table'
echo '---\nheader: True\nalignment: LRR\n---'
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 ORDER BY Filename"
echo '```'
echo
......@@ -88,16 +96,16 @@ reports/translations-worklog.md: combined-worklogs.sqlite combined-daylog.sqlite
echo
echo "Days spent at office: $${days}"
echo
echo '``` table'
echo '---\nheader: True\n---'
echo '```table'
echo '---\nheader: True\nalignment: LR\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 ORDER BY Date"
echo '```'
echo
fi
echo
done
done |
$(PANDOC) $(PANDOCARGS) -F pantable -o $@
done | $(PANDOC) $(PANDOCARGS) -F pantable -t markdown
) > $@
reports/progress.md: $(CCMTOOLKITDIR)/languages.yml repository-lastcommit.ts
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