--- a/Makefile Wed Oct 02 23:31:57 2019 +0200
+++ b/Makefile Thu Oct 03 12:03:50 2019 +0200
@@ -46,14 +46,23 @@
scp build/* globalcode.info:/var/www/sane-software.globalcode.info/v_0/
-# Prints a table with number of items in particular chapters:
-statistics:
+build/statistics.rp: text/ssm.en.xml
+ mkdir -p build
cat text/ssm.en.xml \
| relpipe-in-xmltable \
--namespace "m" "tag:globalcode.info,2019:sane-software/manifesto" \
--relation "chapter" \
--records "//m:chapter" \
--attribute "name" string "m:name" \
- --attribute "item_count" integer "count(descendant::m:item)" \
- | relpipe-out-tabular
-# try also relpipe-out-gui to get the chart
+ --attribute "requirements" integer "count(descendant::m:item[m:type='requirement'])" \
+ --attribute "recommendations" integer "count(descendant::m:item[m:type='recommendation'])" \
+ --attribute "informations" integer "count(descendant::m:item[m:type='information'])" \
+ --attribute "items_total" integer "count(descendant::m:item)" \
+ > build/statistics.rp
+
+# Prints a table with number of items in particular chapters:
+statistics: build/statistics.rp
+ cat build/statistics.rp | relpipe-out-tabular
+
+statistics-chart: build/statistics.rp
+ cat build/statistics.rp | relpipe-tr-cut ".*" "(name|.*s)" | relpipe-out-gui -title "Sane Software Manifesto – chart of rule types"