|
Pages: [1]
|
 |
|
Author
|
Topic: color-code.r (Read 585 times)
|
|
pepiporn
|
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
|
Be more specific - show example of "input" and wanted "output"
|
|
|
|
|
Logged
|
|
|
|
|
pepiporn
|
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
|
Mentioned script colorizes REBOL code using HTML - so You can view it via browser. Last line is example usage. 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: 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
|
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 whiteColor!(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]
|
|
|
 |
News: 01-09-08 Alpha version of REBOL 3 has been released!
2311 Posts in 595 Topics by 4138 Members
Latest Member: Irrederwasy
|