|
Pages: [1]
|
 |
|
Author
|
Topic: Rebol in a WWW Browser (Read 232 times)
|
|
leke
|
I am trying to get this to print out my entire fonts folder in a web browser (one font per line). I managed fonts: read %/c/windows/fonts/ foreach font fonts [print font] which does what I want in the console, but it only prints one font when I try it out in the browser. Here's what I have REBOL []
fonts: read %/c/windows/fonts/ outfilename: %rebol-html!.html
html: copy rejoin [ { <html> <head> <title>Outputting Rebol in a WWW Browser</title> </head> <body> }
foreach font fonts [font]
{ </body> </html> } ]
write outfilename html browse outfilename I am eventually going to display a user defined string in each font on their system, with the font name along side it.
|
|
|
|
|
Logged
|
|
|
|
|
CarlRead
|
Your problem is the... foreach font fonts [font] only returns the last value despite the FOREACH looking through all the fonts. To make it work you'd need to add each font to a string and then return the string when the FOREACH finishes. My approach would be to just add the fonts to your html string without trying to do it all in the one REJOIN. ie, something like this... REBOL []
fonts: read %/c/windows/fonts/ outfilename: %rebol-html!.html
html: copy { <html> <head> <title>Outputting Rebol in a WWW Browser</title> </head> <body> }
foreach font fonts [append html rejoin ["<p>" font "</p>^/"]]
append html { </body> </html> }
write outfilename html browse outfilename
Hope that helps.
|
|
|
|
|
Logged
|
- Carl Read
|
|
|
|
|
Pages: [1]
|
|
|
 |