TW 5.1.22 + CodeMirror + Code Colorizing?

104 views
Skip to first unread message

Gary Zimmer

unread,
Apr 10, 2021, 12:01:21 AM4/10/21
to TiddlyWiki
I've managed to get CodeMirror working fine on my TW one page install hosted on github, but I'd like to get colorizing of my code work as well so it's not so painful to look at a large snippet of code. I can't seem to get any success out of just drag and dropping the JS files for the runmode.js and the colorize.jp from here and TW doesn't seem to recognize the JS files since when I import them the title is just "untitled". Has anyone gotten colorized code snippets to work with CodeMirror and TW?
Thanks

Gary Zimmer

unread,
Apr 10, 2021, 12:02:21 AM4/10/21
to TiddlyWiki
If it matters, the language I primarily write in is C# so I'd like that to work, not JS or CSS

Gary Zimmer

unread,
Apr 12, 2021, 4:47:40 PM4/12/21
to TiddlyWiki
I ended up installing Highlight.js from here:
what I didn't realize for a while was that I needed to define which language I'm using in my code blocks by typing the abbreviation for it next to the  code block symbols, in my case: ```cs

It works, but I was expecting a little bit more color... Oh well, better than the standard text it was before!

Mohammad Rahmani

unread,
Apr 12, 2021, 11:41:21 PM4/12/21
to tiddl...@googlegroups.com
Full description on custom installing Highlight.JS and adding language brushes can be found on TW-Scripts
See for example this permview:  Manually Add More Language Brushes to Highlight.js

When you have a question, TW-Scripts is the first place to see

You can go to https://github.com/kookma/TW-Scripts and star it if you found above info useful!


Best wishes
Mohammad


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/64e54c1e-4473-4bf0-a0a8-f99691cc5583n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages