rigz.htmltools: | Globals | Functions | Types | Modinfo | Source |
DXHTMLStrict , DXHTMLTransitional , TAGS |
CreateHTMLBlock | Create a new tHTMLTag. |
CreateHTMLDoc | Create a new tHTMLDoc. |
LoadHTMLDoc | Load an HTML Document from a file. |
SaveHTMLDoc | Save a tHTMLDoc to a file. |
tDoctype | type for storing different doctypes for WW3 Doctypes. |
tHTMLConstructor | Type for storing HTML tags and tHTMLTag constructors. |
tHTMLDoc | An html doc type. |
tHTMLTag | Type for storing Blocks of HTML. |
tProperty | Type for storing HTML properties/attributes. |
tStyle | tStyle type for storing CSS. |
tStyleProperty | Type for storing Style properties. |
Global DXHTMLStrict:tdoctype | |
Description | Global tDoctype storing the doctype for an XHTML Strict HTML document. |
Global DXHTMLTransitional:tDoctype | |
Description | Global tDoctype storing the doctype for an XHTML Transitional HTML document. |
Global TAGS:tHTMLConstructor | |
Description | Global tHTMLConstructor type for accessing preset HTML tags and constructors for tHTMLTag. |
Function CreateHTMLBlock:tHTMLTag(name:String, container:Int = True, plaintext:Int = False) | |
Returns | New tHTMLTag. |
Description | Create a new tHTMLTag. |
Information | Pass the name of the tag, whehter it can contain children, and specify if it should or shouldn't be plain text (no tag). For best results, use tHTMLConstructors for an easier way to create html blocks. |
Function CreateHTMLDoc:tHTMLDoc(doctype:tDoctype) | |
Description | Create a new tHTMLDoc. |
Information | Pass the doctype, you can use the follwing consts for this: DXHTMLTransitional, DXHTMLStrict. |
Function LoadHTMLDoc:tHTMLDoc(url:Object) | |
Description | Load an HTML Document from a file. |
Function SaveHTMLDoc(url:String, htmldoc:tHTMLDoc) | |
Description | Save a tHTMLDoc to a file. |
Type tDoctype | |
Description | type for storing different doctypes for WW3 Doctypes. |
Methods Summary | |
---|---|
ToString | convert this doctype into a string. |
Functions Summary | |
---|---|
Create | Create a new Doctype. |
Method ToString:String() | |
Description | convert this doctype into a string. |
Function Create:tDoctype(externalid:String, systemid:String, name:String) | |
Returns | a new tDoctype. |
Description | Create a new Doctype. |
Type tHTMLConstructor | |
Description | Type for storing HTML tags and tHTMLTag constructors. |
Information | This type can be accessed through the global Tags and provides a convienient way of constructing tTags. |
Methods Summary | |
---|---|
A | Create and return the HTML tag: a. |
B | Create and return the HTML tag: b. |
BIG | Create and return the HTML tag: big. |
BODY | Create and return the HTML tag: body. |
BR | Create and return the HTML tag: br. |
DIV | Create and return the HTML tag: div. |
EM | Create and return the HTML tag: em. |
H1 | Create and return the HTML tag: h1. |
H2 | Create and return the HTML tag: h2. |
H3 | Create and return the HTML tag: h3. |
H4 | Create and return the HTML tag: h4. |
H5 | Create and return the HTML tag: h5. |
H6 | Create and return the HTML tag: h6. |
HEAD | Create and return the HTML tag: head. |
HR | Create and return the HTML tag: hr. |
HTML | Create and return the HTML tag: html. |
I | Create and return the HTML tag: i. |
IMG | Create and return the HTML tag: img. |
IsContainer | Find out whether an HTML tag can contain other tags. |
IsPlainText | Find out if a node name is plaintext. |
LI | Create and return the HTML tag: li. |
META | Create and return the HTML tag: meta. |
NeedsNewLine | See if a particular tag requires a new line when being formatted into a string. |
P | Create and return the HTML tag: p. |
PlainText | Create and return a tHTMLTag that is just plain text (no html tag) |
SMALL | Create and return the HTML tag: small. |
SPAN | Create and return the HTML tag: span. |
STRONG | Create and return the HTML tag: strong. |
STYLE | Create and return the HTML tag: style. |
SUB | Create and return the HTML tag: sub. |
SUP | Create and return the HTML tag: sup. |
TABLE | Create and return the HTML tag: table. |
TD | Create and return the HTML tag: td. |
TH | Create and return the HTML tag: th. |
TITLE | Create and return the HTML tag: title. |
TR | Create and return the HTML tag: tr. |
TT | Create and return the HTML tag: tt. |
UL | Create and return the HTML tag: ul. |
Method A:tHTMLTag(href:String = "", title:String = "") | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: a. |
Method B:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: b. |
Method BIG:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: big. |
Method BODY:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: body. |
Method BR:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: br. |
Method DIV:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: div. |
Method EM:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: em. |
Method H1:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: h1. |
Method H2:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: h2. |
Method H3:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: h3. |
Method H4:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: h4. |
Method H5:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: h5. |
Method H6:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: h6. |
Method HEAD:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: head. |
Method HR:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: hr. |
Method HTML:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: html. |
Method I:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: i. |
Method IMG:tHTMLTag(src:String = "", alt:String = "") | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: img. |
Method IsContainer:Int(tag:String) | |
Description | Find out whether an HTML tag can contain other tags. |
Method IsPlainText:Int(name:String) | |
Returns | True or False. |
Description | Find out if a node name is plaintext. |
Method LI:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: li. |
Method META:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: meta. |
Method NeedsNewLine:Int(tag:String) | |
Description | See if a particular tag requires a new line when being formatted into a string. |
Method P:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: p. |
Method PlainText:tHTMLTag(text:String = "") | |
Returns | New tHTMLTag. |
Description | Create and return a tHTMLTag that is just plain text (no html tag) |
Method SMALL:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: small. |
Method SPAN:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: span. |
Method STRONG:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: strong. |
Method STYLE:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: style. |
Method SUB:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: sub. |
Method SUP:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: sup. |
Method TABLE:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: table. |
Method TD:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: td. |
Method TH:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: th. |
Method TITLE:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: title. |
Method TR:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: tr. |
Method TT:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: tt. |
Method UL:tHTMLTag() | |
Returns | New tHTMLTag. |
Description | Create and return the HTML tag: ul. |
Type tHTMLDoc | |
Description | An html doc type. |
Information | This type can be used to store an HTML document, specifying a doctype and containing the root html tag. |
Example | Import rigz.htmltools 'Create an HTML document Local htmldoc:tHTMLDoc = CreateHTMLDoc(DXHTMLStrict) 'Create some HTML Tags using Tags object to construct them more easily. Local head:tHTMLTag = Tags.HEAD() Local title:tHTMLTag = Tags.TITLE() 'Use addchild to create a structured HTML document title.AddChild(Tags.PlainText("A Simple HTML Document")) head.AddChild(title) Local body:tHTMLTag = Tags.BODY() Local div:tHTMLTag = Tags.DIV() 'You can also use AddStyle to add inline CSS to HTML Tags div.AddStyle("text-align", "center") div.AddStyle("font-family", "Arial, Verdana, Times New Roman") Local p:tHTMLTag = Tags.P() p.AddChild(Tags.PlainText("This is a very simple HTML document")) div.AddChild(p) body.AddChild(div) htmldoc.AddChild(head) htmldoc.AddChild(body) Print htmldoc.ToString() |
Methods Summary | |
---|---|
AddChild | Add a child tHTMLTag to the root html tag of this HTML doc. |
GetRootHTML | Get the root html tag of the document. |
SetRootHTML | set the root html tag of the document. |
ToString | Convert the HTML document to a string. |
Functions Summary | |
---|---|
Create | Create a new tHTMLDoc. |
Method AddChild(block:tHTMLTag) | |
Description | Add a child tHTMLTag to the root html tag of this HTML doc. |
Method GetRootHTML:tHTMLTag() | |
Returns | tHTMLTag. |
Description | Get the root html tag of the document. |
Method SetRootHTML(htmlblock:tHTMLTag) | |
Description | set the root html tag of the document. |
Information | this should be an "HTML" tag. |
Method ToString:String() | |
Returns | Formatted string. |
Description | Convert the HTML document to a string. |
Information | The string this returns can be loaded into an HTML viewer. |
Function Create:tHTMLDoc(doctype:tDoctype) | |
Description | Create a new tHTMLDoc. |
Information | Pass the doctype, you can use the follwing consts for this: DOCTYPE_XHTML1_TRANSITIONAL, DOCTYPE_XHTML1_STRICT. |
Type tHTMLTag | |
Description | Type for storing Blocks of HTML. |
Information | this type provides the means to store HTML data, with each block being capable of containing child blocks to achieve a proper HTML document structure. |
Methods Summary | |
---|---|
AddChild | Add a child tHTMLTag. |
AddProperty | Add a new property to the html block. |
AddStyle | Add an inline style to the html block. |
AppendText | Append text to a plain text html block. |
GetNewline | Get the value of newline. |
GetStyle | Set the style of this html block. |
GetText | Get the text of a plain text html block. |
SetNewline | Set the value of newline. |
SetStyle | Set the style of this html block. |
SetText | Set the text of a plain text html block. |
ToString | Convert the tHTMLTag into a string. |
Functions Summary | |
---|---|
Create | Create a new tHTMLTag. |
Method AddChild(HTMLBlock:tHTMLTag) | |
Description | Add a child tHTMLTag. |
Information | This is essential if want to add nested html blocks. |
Method AddProperty(name:String, value:String) | |
Description | Add a new property to the html block. |
Information | Adds a new property yo the type for example "src" would be a property of an image tag. |
Method AddStyle(name:String, value:String) | |
Description | Add an inline style to the html block. |
Information | Adds new style property to the html block, passing the name and the value. eg. style="float: right" where float would be the name and left the value. |
Method AppendText(value:String) | |
Description | Append text to a plain text html block. |
Information | If an html block is plain text only, then you can use this to append some text. |
Method GetNewline(value:Int) | |
Description | Get the value of newline. |
Information | If Newline is true then this HTML tag will start on a new line when parsed into a string. By default newline is true. |
Method GetStyle:tStyle() | |
Description | Set the style of this html block. |
Method GetText:String() | |
Description | Get the text of a plain text html block. |
Information | If an html block is plain text only, then you can use this to retrieve the text. |
Method SetNewline(value:Int) | |
Description | Set the value of newline. |
Information | Set newline to false if you don't want this HTML tag to start on a new line when parsed into a string. By default newline is true. |
Method SetStyle(value:tStyle) | |
Description | Set the style of this html block. |
Information | the style will be applied inline to the HTML block. |
Method SetText(value:String) | |
Description | Set the text of a plain text html block. |
Information | If an html block is plain text only, then you can use this to set the text. |
Method ToString:String() | |
Returns | Formatted string. |
Description | Convert the tHTMLTag into a string. |
Function Create:tHTMLTag(name:String, container:Int = True, plaintext:Int = False) | |
Returns | New tHTMLTag. |
Description | Create a new tHTMLTag. |
Information | Pass the name of the tag, whehter it can contain children, and specify if it should or shouldn't be plain text (no tag). For best results, use tHTMLConstructors for an easier way to create html blocks. |
Type tProperty | |
Description | Type for storing HTML properties/attributes. |
Information | An HTML property is for example, on an img tag, you could have the property src and alt. |
Methods Summary | |
---|---|
GetValue | Get the value of the property. |
SetValue | Set the value of the property. |
ToString | Convert the tProperty to a string. |
Functions Summary | |
---|---|
Create | Create a new tProperty. |
Method GetValue:String() | |
Returns | String containing the value. |
Description | Get the value of the property. |
Method SetValue(v:String) | |
Description | Set the value of the property. |
Method ToString:String() | |
Returns | Formated string. |
Description | Convert the tProperty to a string. |
Function Create:tProperty(name:String, value:String) | |
Returns | New tProperty. |
Description | Create a new tProperty. |
Type tStyle | |
Description | tStyle type for storing CSS. |
Information | This type is used for storing CSS properties. |
Methods Summary | |
---|---|
AddProperty | Add a new property to the style, or update an existing one. |
FindStyleProperty | Find a style property. |
StyleExists | Find out if a property exists. |
ToString | Convert the tStyle to a string. |
UpdateProperty | Update an existing style property. |
Functions Summary | |
---|---|
Create | Create new tStyle. |
Method AddProperty(name:String, value:String) | |
Description | Add a new property to the style, or update an existing one. |
Information | Adds a style property, such as text-align, width, background-color etc., pass the name and the value. If the property already exists then it is updated rather then a new one added. |
Method FindStyleProperty:tStyleProperty(name:String) | |
Returns | The tStyleProperty if found, otherwise null is returned. |
Description | Find a style property. |
Method StyleExists:Int(name:String) | |
Description | Find out if a property exists. |
Method ToString:String() | |
Returns | Formatted string. |
Description | Convert the tStyle to a string. |
Method UpdateProperty(name:String, value:String) | |
Description | Update an existing style property. |
Information | If the property is not found then nothing happens. |
Function Create:tStyle(name:String, inline:Int = True) | |
Returns | New tStyle. |
Description | Create new tStyle. |
Information | Pass the name of the style, for example "#content" and true or false as to whether the style is inline, ie., should appear inline with an HTML tag. |
Type tStyleProperty Extends tProperty | |
Description | Type for storing Style properties. |
Methods Summary | |
---|---|
ToString | Convert the tStyleProperty to a string. |
Functions Summary | |
---|---|
Create | Create a new tStyleProperty. |
Method ToString:String() | |
Returns | Formatted string. |
Description | Convert the tStyleProperty to a string. |
Function Create:tStyleProperty(name:String, value:String) | |
Returns | New tStyleProperty. |
Description | Create a new tStyleProperty. |
Version | 1.0 |
---|---|
License | MIT |
Copyright | 2010 Peter J Rigby |
History | v1.0 Initial Version |