From 7a173006fcbd2c8942b6358c90163801d473af79 Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Fri, 7 Feb 2020 17:15:16 +0100 Subject: [PATCH] by_json: add description on patron types --- by_json/filters/patron_types | 1 + by_json/process_pt.sh | 3 +++ by_json/templates/label_patron_types.tmpl | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/by_json/filters/patron_types b/by_json/filters/patron_types index a8413d3..2fc3376 100644 --- a/by_json/filters/patron_types +++ b/by_json/filters/patron_types @@ -1,5 +1,6 @@ .[] | { pid, name, + description, organisation: .organisation."$ref" } diff --git a/by_json/process_pt.sh b/by_json/process_pt.sh index f708f97..3bb174d 100644 --- a/by_json/process_pt.sh +++ b/by_json/process_pt.sh @@ -11,7 +11,10 @@ while read pt do pid=$(echo $pt|jq -r .pid) name=$(echo $pt|jq -r .name) + # fix problems with '<' and '>' in descriptions + description=$(echo $pt|jq -r .description|sed -e 's//\>/g') orga=$(echo $pt|jq -r .organisation) + # write result in output identifier="Type${pid}" label="$(render templates/label_patron_types.tmpl)" diff --git a/by_json/templates/label_patron_types.tmpl b/by_json/templates/label_patron_types.tmpl index cb390d3..1968a71 100644 --- a/by_json/templates/label_patron_types.tmpl +++ b/by_json/templates/label_patron_types.tmpl @@ -1 +1,2 @@ -<${name}
PID: ${pid}> +<${name}
${description}
+PID: ${pid}>