I've written a simple code highlighter helper,
http://www.gignus.com/blog/posts/view/11 that uses GeSHi.

Maybe you can make use of it to highlight your code.

You would have to create a new button in tinyMCE that wraps your code in
<pre class="code php"></pre> or <pre class="code javascript"></pre> or
whatever language (supported by GeSHi) that you want to highlight and then
parse all the text with this helper.

-- 
Matias Lespiau
http://www.gignus.com/



On Jan 31, 2008 9:31 AM, grigri <[EMAIL PROTECTED]> wrote:

>
> Markdown does indeed preserve indentation, because code blocks are
> wrapped in <pre> tags. Syntax hilighting is another matter...
>
> I used to really like Markdown, because it's very readable.
> Unfortunately, (I feel) this comes at a price: loss of flexibility.
> While
> adding support to a bbCode parsing engine for '[php]...[/php]' tags is
> easy, adding stuff to markdown is difficult. I find it particularly
> annoying that there's no way to specify css classes for elements, for
> example.
>
> I've heard people rave about Flay, though I've never used it myself.
> WikiCode looks horribly complicated, but I'm sure it isn't really.
>
> For an example of one way of handling code snippets in articles,
> download the code for the bakery. It's far from perfect, but it has
> its good points!
>
> On Jan 31, 12:12 pm, "dr. Hannibal Lecter" <[EMAIL PROTECTED]>
> wrote:
> > Hi grigri,
> >
> > actually, that might halp me :-)
> >
> > I must agree with you on WYSIWYG, they mostly turn out to be
> > disappointments. WYMeditor seems promising, but it is still unusable
> > in "real life".
> >
> > Markup format is indeed a very good suggestion, very tempting. But I'm
> > not sure if that will solve my problems. How will Markdown handle the
> > code snippets exactly? How to preserve indentation etc.. is it a built
> > in feature or do I need to hack it?
> >
> > Thanks for a prompt reply!
> >
> > > If the users on your website that use the article submission are
> > > expected to add code snippets, it's probably a given that they are
> > > coders of some form or another, so getting them to use some markup
> > > format shouldn't be too hard. bbCode, Flay, Markdown, WikiCode, ...
> > > there's a lot out there, and they all work fine.
> >
> > > If you deem this as too "old-school" then write an ajax-based auto-
> > > preview or something like that. There's always room for more 2.0
> >
> > > Like I said, this probably won't help you if you're determined to use
> > > wysiwyg, but it's my £0.0100332
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to