CodeMirror plugin not highlighting TW5 syntax

89 views
Skip to first unread message

Jeff Vance

unread,
Aug 18, 2016, 10:20:29 PM8/18/16
to TiddlyWiki
Has anyone else noticed this?  I started using the CodeMirror plugin and if I'm using Markdown or TWC syntax, the editor highlights fine.  But for TW5 syntax, it doesn't work.  I thought it was kind of strange since I assumed it would at least work for the default parser.  I checked my  $:/config/CodeMirror  but nothing jumped out at me as missing.  I thought maybe this would handle it, but apparently it only works with TWC:  "$:/plugins/tiddlywiki/codemirror/mode/tiddlywiki/tiddlywiki.js",


Jeremy Ruston

unread,
Aug 19, 2016, 4:03:42 AM8/19/16
to tiddl...@googlegroups.com
Hi Jeff

Has anyone else noticed this?  I started using the CodeMirror plugin and if I'm using Markdown or TWC syntax, the editor highlights fine.  But for TW5 syntax, it doesn't work.  I thought it was kind of strange since I assumed it would at least work for the default parser.  I checked my  $:/config/CodeMirror  but nothing jumped out at me as missing.  I thought maybe this would handle it, but apparently it only works with TWC:  "$:/plugins/tiddlywiki/codemirror/mode/tiddlywiki/tiddlywiki.js”,

I’m afraid to say that there is no TW5 wikitext highlighter available for CodeMirror at the moment. Creating one would be a welcome contribution but is quite an intricate task, requiring detailed knowledge of TW5’s parsing process.

Best wishes

Jeremy.




--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/71ac9365-4723-450a-8255-131e1e1d68a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeff Vance

unread,
Aug 19, 2016, 4:21:49 PM8/19/16
to TiddlyWiki
Ah, ok, then that explains it!  I didn't realize nobody ever created a TW5 highlighter.  I guess it is too significant a change from the TWC highlighter to just make a few updates to that one?

PMario

unread,
Aug 19, 2016, 5:40:07 PM8/19/16
to TiddlyWiki
On Friday, August 19, 2016 at 10:21:49 PM UTC+2, Jeff Vance wrote:
Ah, ok, then that explains it!  I didn't realize nobody ever created a TW5 highlighter.  I guess it is too significant a change from the TWC highlighter to just make a few updates to that one?

Hi Jeff,

I did create the TWc codemirror highlighter. TW5 syntax is much more complex. eg: it allows html + widgets + wikitext. All mixed together. So the new highlighter would need to be based on the cm html highlighter + the tw stuff as overlays. I did create the TWc highlighter, because at that time there was no good external editor to develop and test twc plugins. It was really painful to use plain text.

Now I'm using brackets.io .. If I'm editing widgets or the TW UI, I just use the html highlighter. It isn't perfect, but it highlights enough, to have a better overview as plain text. ... And for the TW wikitext, I don't need the highlighter anymore :) ... Or there wasn't enough motivation/incentive to develop the stuff.

have fun!
mario




Reply all
Reply to author
Forward
0 new messages