Due to some library incompatibilities, I'm not able to use both Pandoc and Heist in the same application. As such, I decided to go with Markdown.JS to handle converting from Markdown format data into HTML in the client's browser. This could have some nice extra benefits in the long run, but in the short run, it is just because Pandoc depends on Blaze-HTML 0.4 and Heist depends on Blaze-HTML 0.5.
So, in a weblog-like application, I have a template that is used to fill out each entry, but then the content of each entry needs to get converted into HTML after the page has been loaded. So, I created a template that looks like this:
<h2> <a href="wiki/${target}"><entryTitle /></a> </h2>
<p class="entryDate"> <entryDate /> </p>
<div id="body_${entryDate}">
<entryBody />
</div>
<script type="text/javascript">
renderDiv("body_" + <entryDate />)
</script>
Unfortunately, the renderDiv call ultimately renders like this:
<script type='text/javascript'>
renderDiv("body_" + <entryDate />)
</script>
I have also tried using the string-embedded form (like I did for the div id in the template):
<script type="text/javascript">
renderDiv("body_${entryDate}")
</script>
Again, it renders verbatim.
How do I convince Heist to splice in the entryDate inside of the javascript?
Alternately, I'm using Prototype.JS as a Javascript library. Is there a way for me to put the script inside of the div and call the script basically with "self"?
<div id="body_${entryDate}">
<entryBody />
<script type="text/javascript">
renderDiv($(self))
</script>
</div>