Re: TW and (Alex Gorbatchev's) SyntaxHighlighter

579 views
Skip to first unread message

PMario

unread,
Jun 30, 2012, 10:05:32 AM6/30/12
to TiddlyWiki
On Jun 30, 1:28 am, Bertrand Goetzmann <bertrand.goetzm...@gmail.com>
wrote:
> Is someone succeeded to integrate TW with Alex Gorbatchev's
> SyntaxHighlighter (http://alexgorbatchev.com/SyntaxHighlighter/) with a
> plugin, or in an other way?
yup.
Do you only need syntax highlighting for documentation purpose only
[1] or do you want realtime syntax highlighting in edit mode [2] too?

Do you need it with for TiddlySpace or a file TW? I think I do have
File versions for sh [1] too. somewhere, may be ... :)

[1] http://syntaxhighlighter.tiddlyspace.com/
[2] http://codemirror.tiddlyspace.com/

Bertrand Goetzmann

unread,
Jul 2, 2012, 6:07:36 AM7/2/12
to tiddl...@googlegroups.com
Thank you! I need it just for documentation purpose in my own TW file.
As I'm relatively new to TW, I didn't understand how to use your plugin; finally it worked by adding all the tiddlers tagged syntax in my TW file, and by adding the tag systemConfig to those that have this tag in your TiddlySpace. 
Can you confirm this?

Cheers,

Bertrand.

PMario

unread,
Jul 2, 2012, 9:58:18 AM7/2/12
to TiddlyWiki
On Jul 2, 12:07 pm, Bertrand Goetzmann <bertrand.goetzm...@gmail.com>
wrote:
> Thank you! I need it just for documentation purpose in my own TW file.
> As I'm relatively new to TW, I didn't understand how to use your plugin;
> finally it worked by adding all the tiddlers tagged syntax in my TW file,
> and by adding the tag systemConfig to those that have this tag in your
> TiddlySpace.
> Can you confirm this?
yes,
If you have a look at the SyntaxHighlighterPlugin3Info [1] tiddler,
there is a "Needed: list tagged syntax" heading, which lists the
dependencies. If you need an other language to be highlighted, there
is some info about this just above the "Needed ... " section.

It would be nice, to get some feedback (from you), what would have
been needed, to get you started faster. So I can add this info and
improve the stuff.

have fun!
mario

[1] http://syntaxhighlighter.tiddlyspace.com/#SyntaxHighlighterPlugin3Info
Message has been deleted

carlos duarte

unread,
May 3, 2013, 2:24:18 PM5/3/13
to tiddl...@googlegroups.com
nevermind, i had deleted the "RequiresShCore.js" from ShBrushCSS.js, which caused this problem. reestablishing that snippet fixed everything!

thanks!

-carlos

On Friday, May 3, 2013 3:55:20 AM UTC-7, carlos duarte wrote:
thanks for your work,

but i got "Error: ReferenceError: SyntaxHighlighter is not defined" in:

ShBrushCSS.js
ShBrushJScript.js
ShBrushPlain.js
ShBrushXml.js

in the plugin manager

how can i fix this? thanks!

-carlos

PMario

unread,
May 4, 2013, 7:54:44 AM5/4/13
to tiddl...@googlegroups.com
Hi Carlos,
Nice you found the issue.

If you need syntax highlighting in edit mode too. codemirror may be an option. http://codemirror.tiddlyspace.com/
There is also a video, how to activate the stuff: https://www.youtube.com/watch?v=J5tq5xv0FHU

have fun!
mario

carlos duarte

unread,
May 6, 2013, 4:19:56 PM5/6/13
to tiddl...@googlegroups.com
by any chance do you know how to "wrap" a transcluded tiddler in code? let's say i have a tiddler that contains a bash script (non-syntax highlighted), and then i want to transclude it somewhere else, but i want the transclusion to be syntax highlighted... how do i do that?

thanks!

-carlos



--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/PhwQzroWz4Q/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

PMario

unread,
May 6, 2013, 5:46:29 PM5/6/13
to tiddl...@googlegroups.com, in...@carlosduarte.info
On Monday, May 6, 2013 10:19:56 PM UTC+2, carlos duarte wrote:
by any chance do you know how to "wrap" a transcluded tiddler in code? let's say i have a tiddler that contains a bash script (non-syntax highlighted), and then i want to transclude it somewhere else, but i want the transclusion to be syntax highlighted... how do i do that?

I think there is no simple way to achieve that, because transcluding tiddler text without {{{}}} will transform line breaks to <br> elements.

so if you have

[mario:~] $ cd
[mario:~] $ ls -a

it will be highlighted like that
[mario:~] $ cd<br>[mario:~] $ ls -a

see the <br> element

--------
Is there a problem, if you have a tiddler eg: myScript that contains:

<code class="brush:bash">
[mario:~] $ cd
[mario:~] $ ls -a
</code>

or

{{{
[mario:~] $ cd
[mario:~] $ ls -a
}}}


if you transclude <<tiddler myScript>> you'll get a syntax highglighted version


For the second version you'll need create a tiddler named: zzConfig tagged systemConfig
that contains

config.options.chkGuessSyntax = true;
config.options.chkExpertSyntax = true;

config.options.txtShText = 'brush:bash';

-----

but I think there is no way around the {{{}}} or //{{{ //}}} ....

see: http://syntaxhighlighter.tiddlyspace.com/#SyntaxHighlighterPlugin3Info for more info.

have fun!
mario

PMario

unread,
May 6, 2013, 6:39:46 PM5/6/13
to tiddl...@googlegroups.com, in...@carlosduarte.info
I think you have a valid usecase, so I'll create an add on.
-m

PMario

unread,
May 6, 2013, 8:31:57 PM5/6/13
to tiddl...@googlegroups.com, in...@carlosduarte.info
Have a look at:

http://syntaxhighlighter.tiddlyspace.com/#SyntaxHighlighterPlugin3Info

section: Macro highlightTiddlerText

have fun!
mario
Reply all
Reply to author
Forward
0 new messages