Arlen,
On Fri, Jun 23, 2017 at 5:01 PM, Arlen Beiler <
arle...@gmail.com> wrote:
> I just have one question, from the perspective of someone who is inspired to
> do this with another web template system.
>
> Why didn't you put the eve text between the opening and closing tags instead
> of using the triple double quote syntax?
[...]
I did not consider putting the text in the body of the tag. Even
though I implemented exactly that in the only other TW widget I've
written (
https://btheado.github.io/jsoneditor.html). When I wrote that
widget I used text references for attribute values instead of the
triple quote or transclusion sytax for attributes. One of the
attributes is for storing output so it had to be a text reference, but
the other attribute was readonly and I should have used it as a value
instead.
I think at that time, I was not aware of the triple double quote
syntax, otherwise I probably would have gone that route. But since I
didn't know about that syntax, I wrote some code to allow the widget
body to be used as input. I didn't find a way to access the widget
contents without rendering the children to a dummy dom node and
extracting the text content (see code at
https://github.com/btheado/jsoneditor/blob/master/jsoneditor-widget.js#L62)
In order to protect the json, inside the widget call,
http://tiddlywiki.com/#Typed%20Blocks%20in%20WikiText are needed:
<$jsoneditor jsonOutput="!!car-json2">
$$$application/json
...schema json here...
$$$
</$jsoneditor>
But for the Eve widget, the eve code will most commonly be stored in
its own tiddler and the transclusion syntax for attributes works just
fine for that. Or for larger amount of Eve code, the filter attribute
can be used to pull the code together from multiple tiddlers like this
example:
https://btheado.github.io/tweve/#flappy%20bird
Hope that helps,
Brian