Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

html

 [1/14] from: louisaturk::eudoramail::com at: 7-Jan-2002 23:23


Hello fellow rebols, Slightly off topic, but I am using rebol to build a web site. For speed in loading purposes is it best to write html tags in upper or lower case. Will it not have to be converted (and thus be slower loading) in one case? Thanks, Louis

 [2/14] from: mtiefert:mindspring at: 7-Jan-2002 21:29


At 11:23 PM 01/07/02 -0600, you wrote:
>Hello fellow rebols, >Slightly off topic, but I am using rebol to build a web site. For speed
<<quoted lines omitted: 3>>
>Thanks, >Louis
Louis -- HTML is case-insensitive -- either is OK. But if you want forward-compatibility with xhtml (a flavor of xml), that _is_ case-sensitive and the tags should be all lower-case. cheers, Marj * * * Marj Tiefert Technical Writer, Website Manager -- and more! http://www.mindspring.com/~mtiefert/resume/MTiefert.html

 [3/14] from: al:bri:xtra at: 8-Jan-2002 18:52


What Marj said. And, to be even more compatible, for tags with no end tag, put in a slash before the end ">", like: <br /> and it will be more compatible. And, if you really want to write HTML fast, have you considered using my HTML rebol dialect? Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [4/14] from: gschwarz:netconnect:au at: 8-Jan-2002 17:01


No speed problem with upper/lower case, but it is always better to have links, tags in lower case. This is because you may move the web site from Windows to Unix and all your links may break because some are upper and some are lower. eg Info-page.html is different to info-page.html Regards, Greg

 [5/14] from: louisaturk:eudoramail at: 8-Jan-2002 0:05


Marj, Ok, I'll go with lower case---that makes it easier to read anyway. Many thanks! Louis At 09:29 PM 1/7/2002 -0800, you wrote:

 [6/14] from: louisaturk:eudoramail at: 8-Jan-2002 0:34


Hi Andrew, At 06:52 PM 1/8/2002 +1300, you wrote:
>What Marj said. >And, to be even more compatible, for tags with no end tag, put in a slash
<<quoted lines omitted: 3>>
>And, if you really want to write HTML fast, have you considered using my >HTML rebol dialect?
You told me about it a long time ago, but at the time I didn't know enough about either rebol or html to know how to use it. Where can I get your dialect? Is it like webpage.r in Rebol---the official guide? Louis

 [7/14] from: louisaturk:eudoramail at: 8-Jan-2002 0:35


Greg, Wow, lots of reasons to use lower-case. Thanks! Louis At 05:01 PM 1/8/2002 +1100, you wrote:

 [8/14] from: john_kenyon:mlc:au at: 8-Jan-2002 17:59


Greg,
>No speed problem with upper/lower case, but it is always better to have >links, tags in lower case. >This is because you may move the web site from Windows to Unix and all
your
>links may break because some are upper and some are lower.
Very true - hence the following code snippet I used to go from Domino NT to AIX. (Has the nice side effect of converting the end of line chars too) Uses the recurse-files script by Bo http://www.rebol.org/file/recursive-dir.r cheers, John REBOL [ ] ; (very old bad code but functional) source-dir: %/home/xxx/temp/html/ all-files: recursive-files source-dir html-files: copy [] foreach file all-files [ if find to-string file ".htm" [ insert html-files file ] ] ; Firsly the html files foreach file html-files [ print file file-contents: read file parse file-contents [ any [ thru {src="} mark: copy file-name :mark to {"} (if string? file-name [ change mark lowercase file-name ]) ] any [ thru {img="} mark: copy file-name :mark to {"} (if string? file-name [ change mark lowercase file-name ]) ] ] write file file-contents ] ; now lowercase all of the file names foreach file all-files [ print file if not strict-equal? to-string file lowercase to-string file [ rename file to-file lowercase to-string file ] ]

 [9/14] from: al:bri:xtra at: 8-Jan-2002 21:32


Andrew wrote:
> > And, if you really want to write HTML fast, have you considered using my
HTML rebol dialect? Louis wrote:
> You told me about it a long time ago, but at the time I didn't know enough
about either rebol or html to know how to use it. Where can I get your dialect? It's on my site: http://valley.150m.com/Rebol/Values/HTML.r and you'll need: http://valley.150m.com/Rebol/Values/ML.r as well. This version won't handle forms. The latest one on my HDD does do forms (added today).
> Is it like webpage.r in Rebol---the official guide?
No. It's much more simpler to use and easier to understand. For example, here's a form that I've been working on: write %Test.html HTML [ Header [ Title "Hello" ] Body [text (Black) bgcolor ("#FFFFFC")][ H1 "Hi!" PostForm http://localhost/cgi-bin/Test.r [ fieldset [ legend "Test" "My Label: " Text Test "Default Text" br fieldset [ legend "Pet Stuff" checkbox/checked Dog "Dog" br checkbox Cat "Cat" br checkbox Bird "Bird" br checkbox Fish "Fish" br "Which pet is your favourite?" br radio/checked Favourite "R" "Raptor" br radio Favourite "B" "Bird" br radio Favourite "C" "Cat" br ] reset "Reset" submit "Go!" br "Please enter test password: " password P "" br button Sample "A sample button" br textarea Area 30x10 "Hello!" br hidden Hiding "Hidden value!" ] ] "This is stuff after the form." ] ] Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [10/14] from: louisaturk:eudoramail at: 8-Jan-2002 3:24


Andrew, Sounds really great, but I would like to do forms. How can I get the verison on your HDD? :>) Louis At 09:32 PM 1/8/2002 +1300, you wrote:

 [11/14] from: al:bri:xtra at: 8-Jan-2002 22:43


Louis wrote:
> Sounds really great, but I would like to do forms. How can I get the
version on your HDD? :>) Hopefully, it's attached to this email. :-) Along with ML.r as it was only a extra keyclick. Just in case, I've CC-ed a copy to your directly. Andrew Martin ICQ: 26227169 http://valley.150m.com/ -><- -- Attached file included as plaintext by Listar -- -- File: ML.r [ Rebol [ Name: 'ML Title: "ML Dialect" File: %ML.r Author: "Andrew Martin" eMail: [Al--Bri--xtra--co--nz] Date: 5/Oct/2001 ] make object! [ Empty-Tag: func [Tag [tag!]][ rejoin ["" join Tag " /" newline] ] Encode: func [Value [any-type!]][ either any [ url? Value issue? Value ][ mold Value ][ join "" Value ] ] Replacements: make block! 0 Inline: func [Value [string!]][ foreach [Search Replacement] Replacements [ replace/all Value Search Replacement ] Value ] Inlines: func [Item [any-type!]][ either string? :Item [ Inline Item ][ :Item ] ] Rejoins: func [Item [any-type!]][ either block? :Item [ rejoin Map Item :Rejoins ][ :Item ] ] Map: function [Block [block!] Function [function!]][Mapped][ Mapped: make block! length? Block foreach Item Block [ insert/only tail Mapped Function :Item ] Mapped ] Recurse: func [Content [block! string! tag!]][ either block? Content [ join "" Map reduce bind Map Content :Inlines 'self :Rejoins ][ Content ] ] Tags: func [Tag [tag!] Content [string! tag! none!] /Break /Breaks][ rejoin [ either any [Break Breaks] [newline][""] Tag either Breaks [newline][""] either none? Content [""] [Content] either Breaks [newline][""] to-tag join "/" first parse Tag none ] ] Dialect: func [Content [block!]][ Recurse Content ] Comment: func [Ignored [block! string! tag!]][ rejoin [<!--> mold Ignored "--"] ] Br: join mold <br/> newline P: function [Content [string! block!] /Left /Center /Right][Tag][ Tag: copy [p] if Left [append Tag [align ("left")]] if Center [append Tag [align ("center")]] if Right [append Tag [align ("right")]] Tags/Break build-tag Tag Recurse Content ] ] ] -- Attached file included as plaintext by Listar -- -- File: HTML.r [ Rebol [ Name: 'HTML Title: "HTML Dialect" File: %"HTML.r" Author: "Andrew Martin" eMail: [Al--Bri--xtra--co--nz] Date: 8/Jan/2002 ] make do %ML.r insert tail [ set 'HTML func [Content [block!]] [ Tags <html> Recurse Content ] Refresh: func [Delay [time!] File [url! file!]] [ Empty-Tag build-tag [ meta http-equiv ("refresh") content ( rejoin [ mold Delay/second "; URL=" Encode File ] ) ] ] StyleSheet: func [File [file! url! none!]] [ if none? File [return ""] Empty-Tag build-tag [ link rel ("stylesheet") type ("text/css") href (Encode File) ] ] JavaScript: function [Text [file! url! string! none!]] [Tag] [ if none? Text [return ""] Tag: copy [script type ("text/javascript") language ("JavaScript")] either string? Text [ Tags/Break build-tag Tag rejoin [ "<!-- " newline Text newline "//-->" ] ] [ append Tag [src (Encode Text)] Tags build-tag Tag none ] ] Title: func [Content [string!]] [ Tags <title> Content ] Header: func [Content [block!]] [ Tags/breaks <head> Recurse Content ] Body: function [Attributes [block!] Content [block!]] [Tag] [ Tag: copy [body] append Tag Attributes Tags/breaks build-tag Tag Recurse Content ] Td: function [Content [string! block!] /Left /Center /Right /Width N [integer! string!]] [Tag] [ Tag: copy [td] if Left [append Tag [align ("left")]] if Center [append Tag [align ("center")]] if Right [append Tag [align ("right")]] if Width [append Tag [width (N)]] Tags build-tag Tag Recurse Content ] Th: function [Content [string! block!] /Left /Center /Right] [Tag] [ Tag: copy [th] if Left [append Tag [align ("left")]] if Center [append Tag [align ("center")]] if Right [append Tag [align ("right")]] Tags build-tag Tag Recurse Content ] Tr: func [Content [string! block!]] [ Tags/Breaks <tr> Recurse Content ] Table: function [ Content [string! block!] /Width W [integer! string!] /Height H [integer! string!] ] [Tag] [ Tag: copy [table] if Width [append Tag [width (W)]] if Height [append Tag [height (H)]] Tags/Breaks build-tag Tag Recurse Content ] Hr: join mold <hr /> newline Div: function [Class [string!] Content [string! block!] /Center] [Tag] [ Tag: copy [div class (Class)] if Center [append Tag [align ("center")]] Tags/Breaks build-tag Tag Recurse Content ] Center: func [Content [string! block!]] [ Div/Center "Center" Recurse Content ] BlockQuote: func [Content [string! block!]] [ Tags/Breaks <blockquote> Recurse Content ] Address: func [Content [string! block!]] [ Tags/Breaks <address> Recurse Content ] IP: function [Content [string! block!] /Left /Center /Right] [Tag] [ Tag: copy [p class ("Initial")] if Left [append Tag [align ("left")]] if Center [append Tag [align ("center")]] if Right [append Tag [align ("right")]] Tags/Break build-tag Tag Recurse Content ] UL: func [Content [block!]] [ Tags/Breaks <ul> Recurse Content ] OL: func [Content [block!]] [ Tags/Breaks <ol> Recurse Content ] Image: function [Picture [file! url!] Alternative [string!] /Size WxH [pair!]] [Tag] [ Tag: copy [img border (0) src (Encode Picture) alt (Alternative) ] if Size [append Tag [width (WxH/x) height (WxH/y)]] Empty-Tag build-tag Tag ] A: function [ Reference [file! url! email! string!] Content [string! block!] /Top /Name /Blank ] [ Tag ] [ if email? Reference [ return MailTo Reference none Content ] Tag: copy [a] if any [Top Blank] [ append Tag [target (either Top ["_top"] ["_blank"])] ] append Tag either Name [ Reference: replace/all copy Reference " " "_" [name (Encode Reference)] ] [ [href (Encode Reference)] ] Tags build-tag Tag Recurse Content ] MailTo: func [eMail [email!] Subject [string! none!] Content [string! block!]] [ Tags build-tag [ a href ( rejoin [ "mailto:" eMail either none? Subject [""] [join "?subject=" Subject] ] ) ] Recurse Content ] GetForm: func [Action [url!] Content [string! block!]] [ Tags build-tag [ form method ("GET") action (Encode Action) ] Recurse Content ] PostForm: func [Action [url!] Content [string! block!]] [ Tags build-tag [ form method ("POST") action (Encode Action) ] Recurse Content ] Submit: func [Label [string!]] [ build-tag [ input type ("submit") value (Label) ] ] Reset: func [Label [string!]] [ build-tag [ input type ("reset") value (Label) ] ] Text: func ['Name [word!] Value [string!]] [ build-tag [ input type ("text") name (mold Name) value (Value) ] ] Password: func ['Name [word!] Value [string!]] [ build-tag [ input type ("password") name (mold Name) value (Value) ] ] TextArea: func ['Name [word!] Size [pair!] Content [string! block!]] [ tags build-tag [ textarea name (mold Name) cols (Size/x) rows (Size/y) ] recurse Content ] Checkbox: function ['Name [word!] /Checked] [Tag] [ Tag: copy [input type ("checkbox") name (mold Name) value ("True")] if Checked [append Tag [checked ("checked")]] build-tag Tag ] Radio: function ['Name [word!] Value [string!] /Checked] [Tag] [ Tag: copy [input type ("radio") name (mold Name) value (Value)] if Checked [append Tag [checked ("checked")]] build-tag Tag ] Button: func ['Name [word!] Value [string!]] [ build-tag [ input type ("button") name (mold Name) value (Value) ] ] Hidden: func ['Name [word!] Value [string!]] [ build-tag [ input type ("hidden") name (mold Name) value (Value) ] ] Fieldset: func [Content [string! block!]] [ tags build-tag [fieldset] recurse Content ] Legend: func [Label [string!]] [ tags build-tag [legend] Label ] ] use [Block] [ Block: make block! 10 foreach [Word Tag] [ U: <u> B: <b> I: <i> Ins: <ins> Del: <del> Big: <big> Em: <em> Small: <small> Sup: <sup> Sub: <sub> Strong: <strong> Pre: <pre> H1: <h1> H2: <h2> H3: <h3> H4: <h4> H5: <h5> H6: <h6> Tt: <tt> Q: <q> Dt: <dt> Dd: <dd> Dl: <dl> NoBreak: <nobr> Li: <li> ] [ append Block compose/deep [ (:Word) func [Content [string! block!]] [ Tags (Tag) Recurse Content ] ] ] Block ] ]

 [12/14] from: louisaturk:eudoramail at: 9-Jan-2002 11:50


Andrew, At 10:43 PM 1/8/2002 +1300, you wrote:
>Louis wrote: > > Sounds really great, but I would like to do forms. How can I get the
<<quoted lines omitted: 4>>
>ICQ: 26227169 http://valley.150m.com/ >-><-
Many thanks! I'm looking forward to trying these scripts out. It may be a few days, however, as I am presently involved in some non-rebol projects. I'll get back with you then as to how I do. Louis

 [13/14] from: izkata:aol at: 22-Mar-2002 17:59


Hi, I am looking for a way to take a line from HTML source and remove everything between the < and >. Maybe parsing would somehow work? Also, when dealing with panels, how do you make scrollbars? Thank for any help, Daniel S.

 [14/14] from: izkata:aol at: 22-Mar-2002 19:08


Nevermind about removing text between < and >. It's in websplit.r But I still don't know about the scrollbars in panels. Thanks, Daniel S

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted