TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Libraries & Extensions (http://www.talkphp.com/libraries-extensions/)
-   -   Prism: a new syntax highlighting engine (http://www.talkphp.com/libraries-extensions/5683-prism-new-syntax-highlighting-engine.html)

kib2 01-19-2011 01:14 PM

Prism: a new syntax highlighting engine
 
Hi to all,

this is my first post here, I'm rather new with PHP programming but not with programming) and I've just build my first app with it. It's called "Prism", it is a syntax highlighting engine.

I already know PHP's got Geshi, but I don't like it too much. Prism is light (~12Ko), extensible and supports a dozen of languages atm (but writting a new one is really easy) among: PHP, JS, HTML, XML, Python, Ruby, etc.

You can play with it here : Prism's pastebin. I just hope my little SQLite db will support your posts!

The Prism library (ie highlighting engine) will be released in the next few days with a good licence.

Cheers:

Kibē.

Salathe 01-19-2011 01:37 PM

Can't really say much until you link to the source. ;-)

kib2 01-19-2011 07:48 PM

Salathe: I think you can; you just have to paste some code and see if it's working fine for you.

Salathe 01-20-2011 07:45 AM

I can't say much, what I will say is that the highlighting doesn't appear finished (missing highlighting on parts of the code which normally would be highlighted differently, in various languages).

kib2 01-20-2011 08:53 AM

Thanks Salathe,

you're right for PHP, all the buildin functions were not part of it. I've updated the php language file so that it should be fine now.

But what are the other ones ? The xml and css you posted seems to render fine for me (maybe you have to change the css theme ?)

Salathe 01-20-2011 01:49 PM

The CSS didn't highlight the attribute selector (like [...]) and the XML didn't highlight the element names. By "didn't highlight" I mean no HTML tags wrapped that particular part of the paste so the highlighter doesn't see them as anything to be highlighted.

I'll have a proper look around this evening, hopefully.

kib2 01-20-2011 03:42 PM

Right again, I've not included attribute selectors because I don't know/use them too much. I've tried to fix them by reading the specs. It just needs testing.

As for the XML you submitted, can you paste it here please so that I can analyse what's going on ?

Thanks again for your help.

Salathe 01-21-2011 07:46 AM

XML Code:
<?xml version="1.0" encoding="UTF-8"?>
<烏語>Китайська мова</烏語>

It's #44 in your pastebin.

P.S. Looks like GeSHi has no problem with it. :-P

kib2 01-21-2011 03:00 PM

I can't see nay problem with it, I just tested and got this too:

Image

Salathe 01-21-2011 07:18 PM

Here's a visualisation of the problem with XML.
Refs: top, bottom.

kib2 01-21-2011 07:42 PM

Well done Salathe; that's fixed now (I think so).

Salathe 01-21-2011 11:24 PM

Great to see improvements already, remember to post back when you open up the source code. :-)

kib2 02-01-2011 05:42 PM

Hi,

sorry for the late, Prism is now avaible here for testing:

Prism

You'll find a little Readme file explaining how to use it. The source code is distributed under the MIT/X11 License.
I hope to have some feedbacks from you, cheers:

Kibē.

Update: Prism's got its page now: Prism


All times are GMT. The time now is 11:46 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0