Combining Parsing engines.

44 views
Skip to first unread message

Matthew Lauber

unread,
Mar 19, 2018, 12:01:50 PM3/19/18
to tiddly...@googlegroups.com
All, 
    I'm working on converting this tool to tiddlywiki as part of my ongoing efforts to build a complete D&D campaign tool in tiddlywiki, and I had a question about parsers.  My GridParser tool is going to return a svg of the grid.  One of the features of that tool is the ability to add comments on the grid itself, and I wanted to make the comments support TiddlyWiki syntax.  Should my GridParser.js file just require() the WikiParser.js file and call WikiParser(null, {{content of comment}}, {}) and then add that as an element in my GridParser's parse tree?  Is there any considerations about the interactions between parsers?  

Matt Lauber

Jeremy Ruston

unread,
Mar 19, 2018, 2:46:42 PM3/19/18
to TiddlyWikiDev
Hi Matt

    I'm working on converting this tool to tiddlywiki as part of my ongoing efforts to build a complete D&D campaign tool in tiddlywiki, and I had a question about parsers.  One of the features of that tool is the ability to add comments on the grid itself, and I wanted to make the comments support TiddlyWiki syntax.  Should my GridParser.js file just require() the WikiParser.js file and call WikiParser(null, {{content of comment}}, {}) and then add that as an element in my GridParser's parse tree?  Is there any considerations about the interactions between parsers?  

Rather than require()ing WikiParser.js you should just be able to call $tw.wiki.parseText("text/vnc.tiddlywiki",text,{parseAsInline: true}) and then splice the returned parse tree into the one that you’re generating.

Best wishes

Jeremy.




Matt Lauber

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/31732956-fc50-4acd-86ba-aa6558d9b03a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthew Lauber

unread,
Mar 19, 2018, 3:32:35 PM3/19/18
to TiddlyWikiDev
Thanks, that's perfect!
Reply all
Reply to author
Forward
0 new messages