Page 1 of 1

Best / Easiest code highlighting

Posted: Sat Jul 22, 2006 3:38 am
by wardjame
Hi all,
I am relatively new to serendipity but I really like how things look so far.

I am very interested in using my blog to post code snippets (php mostly) and simple how-tos with some command line code. I installed the geshi plugin and am able to show highlighted code.

My problem is that code is not shown in the wysiwyg editor and I have to drop down to code view to see what is inside the geshi tags. Also geshi is a little cumbersome when all I want it a little code box to show some command line actions. What is the best combination of wysiwyg editor plugin and code highlighting plugin for s9y? I don't mind the iframes used on http://toys.lerdorf.com but I really need to be able to see the stuff in the editor.

My blog is at www.jamesward.ca if you want to see how I currently have things working.

Thanks in advance for any advice.

Re: Best / Easiest code highlighting

Posted: Mon Jul 24, 2006 9:58 am
by garvinhicking
Hi!

If I understand you correctly, you want to have the final formatted markup view (with syntax highlighting etc.) in your WYSIWYG editor?

I'm afraid that this is not really possible. The reason is that markup transformations only apply in the direction "Original -> Target". If you were to edit text in the "Target" format, the "Original" format would be inevitably lost, because all formating would be saved in HTML. I could make a plugin that renders markup transformations in the WYSIWYG editor. But for instance ":-)" emoticon images would then no longer be ":-)" but instead "<img ..."> to edit. I don't know if this is really the good thing.

Sadly I personally don't work that much with the WYSIWYG editor; I personally would prefer to use the geshi markup language in the plain entry box, because that would give me more overview.

Maybe some other people here have a usual way of dealing with this?

Best regards,
Garvin

Posted: Thu Jul 27, 2006 6:00 pm
by wardjame
Ok that makes sense. I don't really need the text to be fully rendered in the editor though. I just need it to be visible at all.

Right now if I put something in geshi tags in the WYSIWYG editor it just disappears and I have to work in text mode to edit it ore even to know that it is there.

Maybe what I am after is a way to tell the editor to ignore geshi tags so that I can just see:

Code: Select all

<geshi>my code here</geshi>
in the editor. Is that possible?

Posted: Fri Jul 28, 2006 12:29 pm
by garvinhicking
Hi!

Ah, now I understand! Yes, the WYSIWYG interprets everything within <> tags as pure HTML. Sadly making an exception to that does not seem likely to me.

However, have you tried to use [geshi] instead? This should work as well, and it would be preserved in the WYSIWYG editor!

Best regards,
Garvin