We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Color coding of .pde in html files
Page Index Toggle Pages: 1
Color coding of .pde in html files (Read 728 times)
Color coding of .pde in html files
May 25th, 2008, 12:17am
 
Hello,

I am improving the design in OpenProcessing.org, and thinking to show the source code on the sketch page, check this page:
http://www.openprocessing.org/visuals/forProcessing.php?visualID=198
(temporary design, links don't work)

Is there any javascript/php library that I can use in the webpage to color code the source code??

I found this old discussion, but it doesn't get me anywhere:
http://processing.org/discourse/yabb/YaBB.cgi?board=proce55ing_website;action=display;num=1095104807;start=15

Thanks,
Sinan

ps: I guess there is already something being used in this forum to color code the code postings. I will try to add a code to this topic as an example.
Re: Color coding of .pde in html files
Reply #1 - May 25th, 2008, 12:36am
 
I couldn't find the way, but I am looking for something to do this:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Sound;action=display;num=1211549775;start=0#0

See how the code is colored.
Re: Color coding of .pde in html files
Reply #2 - May 25th, 2008, 1:12am
 
Maybe have a look into Processing's sources to see how its Tools > Copy for discourse method is used? Maybe you can easily translate it into PHP/Javascript?

edit: Interesting code is here :
http://dev.processing.org/source/index.cgi/trunk/processing/app/src/processing/app/tools/DiscourseFormat.java?view=markup

Re: Color coding of .pde in html files
Reply #3 - May 25th, 2008, 1:48am
 
I wrote a copy for web tool. You can get the code here

http://www.polymonkey.com/blogger-polymonkey/2008/05/copy-for-html.html

It's not exactly what you need but the code shows how to convert between the copy for discourse output to a nice web friendly version. The discussion for the tool started on this post.

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=os_libraries_tools;action=display;num=1210889647

Once the semester is over I was going to have a crack at adding it to the processing app.

MattD
Page Index Toggle Pages: 1