syntax highlighter - the comeback :)

Questions about how to use the online - editors and suggestions how to improve them
Post Reply
pmolik
Posts: 13
Joined: Sun Apr 29, 2012 12:48 pm

syntax highlighter - the comeback :)

Post by pmolik » Tue Apr 23, 2013 7:27 pm

Hello again CMSimple!

I'm still having issue with code highlighting (view the topic), but now it's a bit different. I replaced tiny with fckeditor, and I'd like to use the PBCKCode plugin which looks great. Unfortunately I couldn't make it work, I think I missed something. Because my 0 skill in web, I can't figure out the reason.

I added the plugin in /plugins/ckeditor/plugins directory, then modified config.js from ckeditor as requested for the plugin installation... but the icon does not appear :cry:

Could someone test if this plugin works, and the steps to do so please?

Cya

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: syntax highlighter - the comeback :)

Post by cmb » Wed Apr 24, 2013 12:29 am

Hello again pmolik, :)

the fine PBCKCode plugin requires CKEditor 4, but the latest version of CKEditor4CMSimple uses still CKEditor 3.x. Holger is working on the integration of CKEditor 4 to CMSimple_XH, but I don't know when a first version will be released (there were quite some changes from CKEditor 3 to 4).

So probably the best solution for now is to use Syntaxhighlighter_XH, despite it's an alpha version. At least you may test it. Of course, any feedback is welcome.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

pmolik
Posts: 13
Joined: Sun Apr 29, 2012 12:48 pm

[solved]Re: syntax highlighter - the comeback :)

Post by pmolik » Wed Apr 24, 2013 6:04 pm

Ho dear cmb! :) nice to see you again,

Thanks for the plugin, actually it's pretty good (much better than geshi hand crafted solution!), so I will adopt it for the moment. The only drawback is that (it seems to me) the 'tab' key can't be used to tabulate the code, but I don't know if there is any solution for that actually... and it's a minor problem anyway.

I set the topic as "solved", because this solution is good enough!

Bye

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: syntax highlighter - the comeback :)

Post by cmb » Thu Apr 25, 2013 1:51 pm

pmolik wrote:The only drawback is that (it seems to me) the 'tab' key can't be used to tabulate the code, but I don't know if there is any solution for that actually
That's always a bit of a problem with simple textareas. The tab character defaults to jump to the next element, which can have the focus, in a browser. One can catch that with JavaScript, and insert the tab character, but this is not handled by the undo functionality (CTRL+z).

You may consider to actually write the code in an external editor, and just copy&paste it in the textarea. This way tabs will be preserved (at least for the tinyMCE plugin; I have not checked the CKeditor plugin). Syntaxhighlighter defaults to 4 spaces for a tab, which is configurable, but that's not (yet?) implemented for Syntaxhighlighter_XH.

PS: If JavaScript is disabled in the visitors browser, a tab will be rendered as 8 spaces usually. So it might be better to avoid tab characters at all.

PPS: If I'm not mistaken the value of the class attribute, which is needed for the SyntaxHighlighter, is invalid HTML 4.01 (that's not reported by the W3C validator, though). It may be valid HTML5 however.
Last edited by cmb on Thu Apr 25, 2013 2:08 pm, edited 1 time in total.
Reason: added PSs
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply