custom syntax highlighting inside TW

525 views
Skip to first unread message

Joe

unread,
Jul 29, 2008, 10:28:04 AM7/29/08
to TiddlyWiki
I'm using TW as a repository for code and documentation, and would
like to have the code highlighted inside {{{ }}} tags.

I did a bit of searching, and found "syntaxify": http://bob.mcelrath.org/syntaxify.html

Is that my best option?

Daniel Baird

unread,
Aug 1, 2008, 10:47:07 PM8/1/08
to Tiddl...@googlegroups.com

I'm gonna say "yes". If you write new highlighters, please share them
(in fact, share them around before you finish, and you might get some
help).

;Daniel

--
Daniel Baird
/to be or not to be/ => /(2b|[^2]b)/ => /(2|[^2])b/ => /.b/
...optimise your regexes, people!

Xavier Vergés

unread,
Aug 2, 2008, 2:13:22 AM8/2/08
to TiddlyWiki
If "single-file-ness" is not important, you may take a look at a
http://www.dreamprojections.com/syntaxhighlighter -> now at
http://code.google.com/p/syntaxhighlighter/
It is very good, but I have never used within a tiddlywiki.

No matter that, its code may be helpful to steal keywords and regexps
when writting a new highlighter. E.g.
http://code.google.com/p/syntaxhighlighter/source/browse/trunk/Scripts/shBrushSql.js

-Xv


On Aug 2, 4:47 am, "Daniel Baird" <danielba...@gmail.com> wrote:

Morris Gray

unread,
Aug 2, 2008, 4:30:24 AM8/2/08
to TiddlyWiki
This is discussed, coincidently, in a parallel thread right now if I
understand them right.

http://groups.google.com/group/TiddlyWiki/browse_thread/thread/2be826cf783414c4

You can highlight code inside triple brackets as shown below.

http://twhelp.tiddlyspot.com/#ViewerCode

Morris Gray
http://twhelp.tiddlyspot.com
A TiddlyWiki help file for beginners

ken robertson

unread,
Aug 9, 2008, 7:23:39 AM8/9/08
to Tiddl...@googlegroups.com
On Sat, Aug 2, 2008 at 6:30 PM, Morris Gray <msg...@symbex.net.au> wrote:
You can highlight code inside triple brackets as shown below.

http://twhelp.tiddlyspot.com/#ViewerCode

Morris Gray

G'day Morris,

"The tiddler 'ViewerCode' doesn't yet exist. Double-click to create it"

--
Regards
Ken

Morris Gray

unread,
Aug 9, 2008, 9:37:38 AM8/9/08
to TiddlyWiki
> "The tiddler 'ViewerCode <http://twhelp.tiddlyspot.com/#ViewerCode>' doesn't
> yet exist. Double-click to create it"

Thanks Ken, Somewhere along the way it got changed to a more
appropriate http://twhelp.tiddlyspot.com/#ViewingCode but either will
work now.

Morris Gray
http://twhelp.tiddlyspot.com
A TiddlyWiki help file for beginners
http://sidebarpluginvault.tiddlyspot.com
World's largest squeezable TW plugin database


On Aug 9, 9:23 pm, "ken robertson" <ken.robert...@gmail.com> wrote:
> On Sat, Aug 2, 2008 at 6:30 PM, Morris Gray <msg...@symbex.net.au> wrote:
> > You can highlight code inside triple brackets as shown below.
>
> >http://twhelp.tiddlyspot.com/#ViewerCode
>
> > Morris Gray
> > <http://twhelp.tiddlyspot.com>
>
> G'day Morris,
>
> "The tiddler 'ViewerCode <http://twhelp.tiddlyspot.com/#ViewerCode>' doesn't

daemon8

unread,
Aug 14, 2008, 4:32:29 AM8/14/08
to TiddlyWiki
This works well. Just install as a plugin and then surround your code
with:

<code>
</code>

http://genisis329.googlepages.com/TWMath.html#CodeFormatter

wolfgang

unread,
Aug 15, 2008, 10:39:23 AM8/15/08
to TiddlyWiki
> > I did a bit of searching, and found "syntaxify":http://bob.mcelrath.org/syntaxify.html
>
> > Is that my best option?
>
> I'm gonna say "yes". If you write new highlighters, please share them
> (in fact, share them around before you finish, and you might get some
> help).
>
> ;Daniel

Sadly, SyntaxifyPlugin doesn't seem to be compatible anymore with the
latest 2.4.0 TiddlyWiki version. With Core Plugins neither.

W.

Reply all
Reply to author
Forward
0 new messages