TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-19-2011, 01:14 PM   #1 (permalink)
The Wanderer
 
Join Date: Jan 2011
Posts: 7
Thanks: 0
kib2 is on a distinguished road
Default 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ē.

Last edited by kib2 : 01-19-2011 at 01:16 PM. Reason: forgotten talking about my sqlite db
kib2 is offline  
Reply With Quote
Old 01-19-2011, 01:37 PM   #2 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Can't really say much until you link to the source.
Salathe is offline  
Reply With Quote
Old 01-19-2011, 07:48 PM   #3 (permalink)
The Wanderer
 
Join Date: Jan 2011
Posts: 7
Thanks: 0
kib2 is on a distinguished road
Default

Salathe: I think you can; you just have to paste some code and see if it's working fine for you.
kib2 is offline  
Reply With Quote
Old 01-20-2011, 07:45 AM   #4 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

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).
Salathe is offline  
Reply With Quote
Old 01-20-2011, 08:53 AM   #5 (permalink)
The Wanderer
 
Join Date: Jan 2011
Posts: 7
Thanks: 0
kib2 is on a distinguished road
Default

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 ?)
kib2 is offline  
Reply With Quote
Old 01-20-2011, 01:49 PM   #6 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

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.
Salathe is offline  
Reply With Quote
Old 01-20-2011, 03:42 PM   #7 (permalink)
The Wanderer
 
Join Date: Jan 2011
Posts: 7
Thanks: 0
kib2 is on a distinguished road
Default

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.
kib2 is offline  
Reply With Quote
Old 01-21-2011, 07:46 AM   #8 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

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.
Salathe is offline  
Reply With Quote
Old 01-21-2011, 03:00 PM   #9 (permalink)
The Wanderer
 
Join Date: Jan 2011
Posts: 7
Thanks: 0
kib2 is on a distinguished road
Default

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

Image

Last edited by kib2 : 01-21-2011 at 03:00 PM. Reason: image does not appear
kib2 is offline  
Reply With Quote
Old 01-21-2011, 07:18 PM   #10 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Here's a visualisation of the problem with XML.
Refs: top, bottom.
Salathe is offline  
Reply With Quote
Old 01-21-2011, 07:42 PM   #11 (permalink)
The Wanderer
 
Join Date: Jan 2011
Posts: 7
Thanks: 0
kib2 is on a distinguished road
Default

Well done Salathe; that's fixed now (I think so).
kib2 is offline  
Reply With Quote
Old 01-21-2011, 11:24 PM   #12 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Great to see improvements already, remember to post back when you open up the source code.
Salathe is offline  
Reply With Quote
Old 02-01-2011, 05:42 PM   #13 (permalink)
The Wanderer
 
Join Date: Jan 2011
Posts: 7
Thanks: 0
kib2 is on a distinguished road
Default

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

Last edited by kib2 : 02-05-2011 at 05:40 PM.
kib2 is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax error here why?.. codefreek Absolute Beginners 5 08-12-2008 06:39 PM
MySQLs new storage engine Alan @ CIT MySQL & Databases 0 01-29-2008 10:58 PM
Syntax Highlighting? danielneri General 7 01-09-2008 02:02 PM
Added Geshi Syntax Highlighting Wildhoney News and Announcements 11 11-20-2007 02:51 AM
Need your feedback Tanax Absolute Beginners 29 10-11-2007 04:50 PM


All times are GMT. The time now is 08:17 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design