Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: color-code.r
Pages: [1] Print
Author Topic: color-code.r  (Read 587 times)
pepiporn
Newbie
*
Offline Offline

Posts: 8


View Profile
color-code.r
« on: April 20, 2004, 02:44:14 PM »

found this script in the rebol.org script library. my problem is: i don't really know awhat this thing is doing, and how i can use it.

my problem is: i wan't to colorize rebol code, and this thing seems to work.  but what i wan't is to render a string.

functinolatiy should look like this:
-> give this script a string -> this script returns a formated string

so anyone in here might see how this script is working and how i can customize it, if possible?
Logged
Alekk
Newbie
*
Offline Offline

Posts: 11


View Profile
color-code.r
« Reply #1 on: April 22, 2004, 09:45:30 AM »

Be more specific - show example of "input" and wanted "output"
Logged
pepiporn
Newbie
*
Offline Offline

Posts: 8


View Profile
color-code.r
« Reply #2 on: April 28, 2004, 04:30:14 PM »

oke erm, you should all know what rebol code should look like.

exmpl:

handle: func [s /local] [
      return join "hello world, says: " s
]


now i want to have the code returned colorized. for instance func, return and join in blue and the string ( "hello world, says: " ) in red.
Logged
Alekk
Newbie
*
Offline Offline

Posts: 11


View Profile
color-code.r
« Reply #3 on: May 04, 2004, 06:14:58 AM »

Mentioned script colorizes REBOL code using HTML - so You can view it via browser.

Last line is example usage.
Code:
write %color-code.html color-code read %color-code.r

So if You want this sort of "render", but for string - modify "color-code" function deleting this lines:
Code:
insert out {<html><body bgcolor="#ffffff"><pre>}
append out {</pre></body></html>}

But in fact I'm still not sure what You want :-)




Logged
Sunanda
Full Member
***
Offline Offline

Posts: 113


View Profile
color-code.r
« Reply #4 on: May 07, 2004, 07:52:08 PM »

As Alekk says. that script assumes the target code will be rendered in a browser, and so the coloring is done with html.

Here's an example of it in use:

back and white

Color!

(Actually the Library uses a modified version of the color-code.r script to do the colring with CSS classes rather than hard-coded font tags. But the principle is the same).

Is this the sort of thing you want to do?
« Last Edit: May 07, 2004, 07:52:51 PM by Sunanda » Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: color-code.r
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2008, 07:50:30 AM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2311 Posts in 595 Topics by 4142 Members
Latest Member: FoxxxTrott

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc