I am searching for existing functionality, either in Python or JavaScript, that allows me to extrapolate the internal JSON structure of an HTML template when using handlebars. There could be loops and nested data structures in there as well. For example:
<div class="entry">
<h1>{{title}}</h1>
<div class="body">
{{body}}
</div>
<div>
Author: {{author.firstName}} {{author.lastName}}
</div>
should return
{
"title": "",
"body": "",
"author": {
"firstName": "",
"lastName": "",
}
}
Any help would be highly appreciated. Thanks in advance