I am using mustache on the command line to embed a JSON object inside of <script>
tags within an HTML object.
cat sampleData.json | mustache - man_report.mustache > output.html
Sample data looks like this:
{"report_type":"total_by_age_group",
"data":[{"age_group":"Age 41 - 65","percent":41.04},
{"age_group":"Age Over 66","percent":19.11},
{"age_group":"Age < 18 Or Invalid Birth Date","percent":0.00},
{"age_group":"Age 18 - 25","percent":8.03},
{"age_group":"Age 26 - 40","percent":31.82}]}
Which is what I would like to also see in the resultant HTML file.
report.mustache looks like:
reportObject = {{data}}
output.html looks like this:
reportObject = [object Object],[object Object],[object Object],[object Object],[object Object]
I just want the exact same JSON as I started with. Any ideas?