+print_structured() {
+ pp=${2-$pretty}
+ # Handle csv and table printing
+ query="(.[0] | keys_unsorted | map(ascii_upcase)), (.[] | [.[]])|${1-@csv}"
+
+ # Handle printing as key value pairs
+ if [[ ${1} == 'pairs' ]]; then
+ query='.[] | "--------------",(to_entries[] | [.key, "=", .value] | @tsv)'
+ fi
+
+ # Manage pretty printing
+ if [[ $pp -eq 1 ]]; then
+ echo "${simple_json}" | jq --raw-output "$query" | column -t -s$'\t' | sed -e 's/"//g'
+ else
+ echo "${simple_json}" | jq -r "$query"
+ fi
+}
+
+print_html() {
+ data=$(print_structured '@csv' 1)
+
+ html="
+ <table>
+ $(
+ print_header=true
+ while read d; do
+ if $print_header; then
+ echo "<tr><th>${d//,/<\/th><th>}</th></tr>"
+ print_header=false
+ continue
+ fi
+ echo "<tr><td>${d//,/</td><td>}</td></tr>"
+ done <<<"${data}"
+ )
+ </table>"
+ echo "$html"