Home   News   Product   Order   Forum   Feedback   Partner   Profile © Neatware 1999
Neatware Snaml: Document
HTML Document
Snaml :: Last Update: Mon Mar 08 12:09:58 1999
  1. HTML Document Structure

    HTML (HyperText Markup Language) is a standard for Web page. Element and its attributes are basic components of HTML. There are three types of element: start tag, end tag, and empty tag. The start and end tag has the format <element attribute> and </element> respectively. The text between the start tag and the end tag is called content. The content may be any Snaml comamnds. An element may have no end tag. An empty element has neither end tag nor content. An element name is always case-insensitive.

    Attributes are properties of an element. The attribute='value' pairs are attached behind the start element name and inside the < >. Any number of attribute value pairs may be attached in arbitrary order. The attributes that are not used in the start tag are set to default values. Boolean attribute may only have the value. Usually, double quotation mark " " and single quotation mark ' ' group the value. . In Snaml we prefer to use single quote ' ' as value grouping. To specify attribute name it is better to use letters, digits, hyphens and periods. Attribute name is case insensitive, but the case of a value may dependent on the definition of an element.

    In Snaml, _element and element_ command with underscore in the head and end represent the start tag and the end tag. One argument of the start element command is its attribute. The empty element is represented as double underline element (__element). It specifies that no content and end tag are expected. The empty element in the HTML is the same as the start tag but in the XML there exist another expression

    	_html
    	  _head;
    	    _title; _quote "Title"; title_
    	  head_
    	  _body "bgcolor='black' color='white'"
    	    _quote "Document Body"
    	  body_
    	html_ 

  2. DocType

    __doctype command specifies the version number, language, and html standard. strict.dtd, loose.dtd, and frameset.dtd specify the HTML DTD (Document Type Definition) files. A HTML __doctype command example is:

    	__doctype {HTML PUBLIC "_//W3C//DTD HTML 4.0//EN" 
    	  "http://www.w3.org/TR/REC-html40/strict.dtd"}

  3. HTML

    _html and html_ are start and end element of a HTML document. It is deprecated to set attributes on the _html start command since you can set the document and version information in the _doctype command. The simplest HTML document is:

    	_html
    	html_ 

  4. Head

    _head command specifies the human readable and machine readable head information of a HTML document. The _title command must appear inside the _head content. Other commands are optional.

    A browser will display the value of the title attribute such as title='Document' on the title bar. Typically, 'title' attribute is used as a tooltip of a command.

    	_head
    		_title "title='Document Title'"; _quote "Title"; title_
    	head_
    _meta command sets machine readable information. Its 'name' attribute defines the property name; 'content' attribute defines the property value; 'scheme' attribute interprets the property's value; 'lang' attribute specifies the language; and 'http-equiv' attribute provides HTTP server information for response header.
    	_meta "name='author' content='David Robert' scheme='ISBN Author'"
    	_meta "http-equiv='Expires' content='Fri, 25 Dec 1998'"
    http-equiv may be used to wait seconds and refresh to another page. Following example waiting 2 seconds and switch to new URL in content.
    	_meta "http-equiv='refresh' content='2, http://www.neatware.com'"
    When the name's value is keyword it is helpful to list a series of keywords in the content's value for search engine readable.
    	_meta "name='keywords' lang='en-us' content='Snaml html web programming'"

  5. Body

    _body command specifies the content of a HTML document. The 'background' attribute may be an image or a color value; 'text' attribute is the color of the foreground text; 'link' attribute sets the color of text for unvisited hypertext link; 'vlink' sets the color of text for visited hypertext link; and 'alink' sets the color of text for user selected hypertext link. Using of _body's attributes is deprecated. Style sheets are now the preferred way to describe the presentation.

    	_html
    	_head
    	  _title; _quote "Body"; title_
    	head_
    	_body "bgcolor='white' text='black' 
    	  link='red' alink='yellow' vlink='green'"
    	  _quote "HTML content"
    	body_
    	html_

  6. H1-H6

    _h1 to _h6 are heading commands to describe the topic of a section. There are six levels. _h1 is the highest level (usually larger font) and _h6 is the lowest level. These commands are widely used with CSS.

    	_html
    	_head
    	  _title; _quote "H1 to H6"; title_
    	  _style "type='text/css'"
    	  _rule "h1" { font-style: italic; color: green }
    	  _rule "h2" { color: green }
    	  style_
    	head_
    	_body
    	  _h1; _quote "H1 Title"; h1_
    	  _h2; _quote "H2 Title"; h2_
    	body_
    	html_ 

  7. Block

    The _div and _span commands offer a generic mechanism to construct structure documents. _div and _span define content to be block and inline respectively. By using 'classid' and 'id' attributes, authors may easily control the content in the block for presentation. _div and _span are prefered commands to separate structure and presentation.

    	_div "id='David' class='client'"
    	_span "class='title'"; _quote "Client information:"; span_
    	_table "class='data'"
    	  _tr 
    	    _th; _quote "Last name:"; th_
    	    _td; _quote "David"; td_
    	  tr_
    	  _tr 
    	    _th; _quote "First name:"; th_
    	    _td; _quote "Robert"; td_
    	  tr_
    	  _tr
    	    _th; _quote "Tel:"; th_
    	    _td; _quote "(905) 534-2812"; td_
    	  tr_
    	  _tr 
    	    _th; _quote "Email:"; th_
    	    _td; _quote "robertd@neatware.com"; td_
    	  tr_
    	table_
    	div_ 

Snaml :: Last Update: Mon Mar 08 12:09:58 1999
HTML Document
Neatware Snaml: Document
Home   News   Product   Order   Forum   Feedback   Partner   Profile © Neatware 1999