How to generate colorized HTML from rebol scripts ?
[1/8] from: jason::cunliffe::verizon::net at: 19-May-2002 18:29
Need to create nicely indented colorized HTML straight from REBOL source code.
What do you recommend?
thanks
./Jason
[2/8] from: brett:codeconscious at: 20-May-2002 19:02
I don't quite understand. An elaboration please :^)
Regards,
Brett.
[3/8] from: sunandadh:aol at: 20-May-2002 4:33
Hi Jason,
> Need to create nicely indented colorized HTML straight from REBOL source
code.
> What do you recommend?
Sounds fun! I'd suggest two things:
1. Read _Rebol: the Official Guide_
One of the extended coding examples is the development of a pretty-print
routine. It'll take get you up to speed on how to parse rebol code.
2. Check some back threads here about coding layout style
There has been much discussion about the ways to layout Rebol code. Of
course, you can't go wrong by using the "official" layout guidelines given on
the Rebol site. But you could win some friends by offering different styles;
and the back threads do throw up some tricksy issues with the "official"
style that you'll need to address.
Good luck!
Sunanda.
[4/8] from: nitsch-lists:netcologne at: 20-May-2002 16:37
Am Montag, 20. Mai 2002 00:29 schrieb Jason Cunliffe:
> Need to create nicely indented colorized HTML straight from REBOL source
> code. What do you recommend?
>
does http://www.reboltech.com/library/scripts/colorize.r work for you?
> thanks
> ./Jason
Volker
[5/8] from: jason:cunliffe:verizon at: 20-May-2002 14:15
> I don't quite understand. An elaboration please :^)
Daily I use UltrEdit32, and Flash. Like many tools they have colored syntax
highlighting. I want to be able to publish REBOL scripts as HTML with the sme
indentation and colored syntax highlighting.
I used to have some pretty-print tools for LINGO and also Python which did just
that. Googling around last night I found:
colorize.r
by Jeff Kreis
30-Jun-1999
Purpose: {Syntax highlighting for HTML display of REBOL scripts}
http://www.reboltech.com/library/html/colorize.html
But when I try to run it on itself I get this:
>> do load %colorize.r
>> colorize %colorize.r
Couldn't find this string: *_HT_**_HT_*
Couldn't find this string: *_HT_*
** Script Error: insert expected series argument of type: series port bitset
** Where: font
** Near: insert mark color
insert skip
ahhmm.. I must be doing something dumb!@
./Jason
[6/8] from: anton:lexicon at: 23-May-2002 3:23
You can probably expect to find that colorize won't work
on itself. I didn't trace that bug, but it looks like
it could be that it is picking up its own key strings.
I started to run a test on all my scripts like this
(and this is a good demo of my tree):
site: http://anton.idatam.com.au/rebol/
do load-thru site/library/include.r
include [site/library/tree.r [tree]]
tree/quiet/code %/D/Anton/Dev/Rebol/View/ [
foreach file files [
if %.r = suffix? file [
prin file
save join %/D/Anton/Dev/Rebol/View/test/colorize/ [
file %.html
] colorize dir/:file
print "^- OK"
]
]
]
It seems to handle most files, but it bombs out on a fair
percentage, just guessing around 20%.
Because %colorize.r uses 'load, it eventually runs out of words.
At this point, I got:
>> length? first system/words
== 8062
It was fun browsing the entire collection with:
foreach file read %./ [browse file]
iexplore.exe couldn't handle so many, crashing out a lot,
and the rebol process (beta) in which I issued the above line crashed
as well the first time.
What fun. :)
Anton.
[7/8] from: tim:johnsons-web at: 21-May-2002 12:21
> Am Montag, 20. Mai 2002 00:29 schrieb Jason Cunliffe:
> > Need to create nicely indented colorized HTML straight from REBOL source
> > code. What do you recommend?
> >
> does http://www.reboltech.com/library/scripts/colorize.r work for you?
Hi:
Another alternative is to just load the script into gvim (gui mode
of vim) and and choose syntax->convert to HTML
Warning: vim can be either addictive or drive you nuts :-).
'evim' which comes with versions 6.0.... on both windows
and Linux is vim without the 'mode', probably much easier for
the newcomer to use.
-tj-
> > thanks
> > ./Jason
<<quoted lines omitted: 3>>
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Tim Johnson <[tim--johnsons-web--com]>
http://www.alaska-internet-solutions.com
http://www.johnsons-web.com
[8/8] from: jason:cunliffe:verizon at: 24-May-2002 19:20
> > does http://www.reboltech.com/library/scripts/colorize.r work for you?
> Hi:
<<quoted lines omitted: 4>>
> and Linux is vim without the 'mode', probably much easier for
> the newcomer to use.
Useful to know about. I've not touched 'evim'. REBOL is addictive enough!
Anyway, I need dynamic conversions for server-side tasking.
http://www.reboltech.com/library/scripts/colorize.r is working ok now thanks to
Anton's tip :-)
./Jason
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted