Neatware Header
Home   Products   Forums   Partners   Buy   Company   Contact   Blog   

Text

Text Module consists of h1-h6 for heading; div, p, and pre for block; span, br, em, and strong for inline. Other deprciated commands are abbr, acronym, address, cite, code, dfn, kbd, samp, var, q, and blockquote. Developers should avoid to use the deprciated commands.

  • Whitespace

    Whitespaces are space, tab, form feed (), and zero-width space (​). The carriage return (CR) and line feed (LF) are also whitespaces in the XHTML document. Whitespace characters will have no visual formatting effects. A number of whitespace will only compact to one space.

  • Heading

    _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. You need to set their attributes in the style sheet.

    _body
      _h1; quote "H1 Title"; h1_
      _h2; quote "H2 Title"; h2_
    body_   
    
  • Block

    The _div command offers a generic mechanism to construct structure documents. _div defines block content. By using 'class' and 'id' attributes, authors may easily control the content in the block for presentation. _div along with inline block_span commands are prefered commands to separate structure and presentation. For example,

    _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_
    
  • Paragraph

    _p command defines a paragraph. It is also used as a newline in the Snaml. Its 'clear' attribute specifies the property that floats around another object. clear='all' will terminate the floating. __br command forces a line break. The character ' ' is a real space.

    Plain hyphen is just a regular character '-'. Usually a browser did not display soft hyphen if a line is not broken at a soft hyphen, otherwise it displays the '-' in the end of a line.

    _pre command defines preformatted text. It will render the text content of the _pre command "as is". All the newline and space characters will be kept.

    _p "clear=right"
      quote "float paragraph" 
      __br
      quote "in the document."
    p_
    
    _pre
      quote "preformatted text with space and newline."
    pre_        
    
  • Inline Block

    The _span command separates the small text inline block. _br is a new line command. Usually it is used with an empty command __br. em and strong are emphasis and strong commonds.

    The _em and _strong are two most common commands to make structural text. _em is emphasis (default italic) and _strong is strong emphasis (default bold).

    _em; quote "The emphasis is italic."; em_
    _strong; quote "The strong is blod."; strong_
    
  • Others

    Other commands work for special purposes. The _cite command is a citation or reference to other source; _dfn command is the defining instance of the enclosed term; _code command is used to represent computer code; and _samp command is for the sample output. In addition, _var command marks the instance of a variable; _abbr command tags abbreviated form; _acronym_kbd command represents the text to be entered by user. Finally, _sup and _sub mark the text as superscript and subscript.

    _cite; quote "citation"; cite_
    _dfn; quote "defining instance"; dfn_
    
    _code; quote "computer code"; code_
    _samp; quote "sample output"; samp_
    _var; quote "variable"; var_
    _abbr; quote "abbreviated form"; abbr_
    
    quote [_acronym_ "acronym"]
    quote [_kbd_ "entered text"]
    quote [_sub_ "subscript"]
    quote [_sup_ "superscript"]
    

    _blockquote and _q command are for long and short quotation respectively. Browsers generally render _blockquote as an indented block. _q command generally shows text with delimiting quotation marks.

    _blockquote "id='group'" 
      quote "block words." 
    blockquote_
    _q; quote "quote words"; q_        
    

    Finally, _ins and _del commands mark the sections of a document that has been inserted or deleted. They are rarely used.

List

Firstly, _ol (order list) command creates a numbered list. Secondly, _ul (unorder list) creates a bulleted list. In their contents, _li represents the marker of an order and unorder list. Finally, _dl creates a definition list where _dt (definition title) and _dd (definition description) are markers for the list elements.

Lists may be nested and combined with different types. The _ol only 'start' attribute specifies the starting marker of the first item in an ordered list (default 1). The 'type' attribute of _ol may have the value '1', 'a', 'A', 'i', 'I' for arabic numbers, lower alpha, upper alpha, lower roman, and upper roman markers respectively. However, the 'type' attribute in _ul sets the shape of markers with value disc, square, and circle. In addition, the _li only 'value' attribute sets the number of the current list item.

  • Unorder list
  •   _ul "type='circle'"; # shape of marker
        _li; quote "First Item" li_
        _li; quote "Second Item" li_
        _li; quote "Third Item" li_
      ul_
    
  • Order list
  •   _ol "start=2 type='i'"
        # starting marker 2 with lower roman
        _li "value='1'"; _quote "1st Item"  
        # current item
        _li; quote "2nd Item" li_
        _li; quote "3rd Item" li_
      ol_
    
  • Definition list
  •   _dl
        _dt; quote "1st Title" dt_ 
        _dd; quote "1st Content" dd_
        _dt; quote "2nd Title" dt_ 
        _dd; quote "2nd Content" dd_
        _dt; quote "3rd Title" dt_
        _dd; quote "3rd Content" dd_
      dl_
    

Link

A link is a connection from one web resource to another.

  • Anchor

    Anchor is the end of a link. A link pointers from source anchor to destination anchor. Users may visit the destination resource by activating a link (e.g. clicking mouse button). The destination anchor may be a resource on the Internet or an element with the id on the XHTML document.

    _a command declares a link in the Snaml. It can only appear as the content of the _body. The content of _a command is a source anchor. A browser will display the content as an underline text or an image in normal. By clicking the text user can switch to the destination anchor that is specified by 'href' attribute with a URL. The 'id' attribute of _a command declares its anchor. Other links may refer to it with #idvalue. Any block commands may specify 'id' attribute for its anchor. The 'title' attribute is used to display an anchor's tooltip. The attribute of _a command can belong to the COMMON attribute set and be other attributes: accesskey, charset, href, hreflang, rel, rev, tabindex, and type. You can use accesskey attribute to define a key shortcut.

    _a "id='token' href='http://www.neatware.com/'"
      quote "Anchor to href URL with Name token"
    a_
    
    _a "href='#token' title='here is the token'"
      quote "Anchor to token in the document"
    a_
    
    _h1 "id='token2'"
      quote "Destination anchor with id"
    h1_
    
  • Link

    __link command defines a relationship between current document and other resources. It may appear in the _head and _body of a Snaml program. __link command may describe the position of a document within a series of documents. The 'rel' (relationship) and 'rev' (reverse) attributes are used for this purpose. __link command may also refer to the external style sheets.

    _head
      _title; quote "Chapter 2"; title_; # current        
      __link "rel='prev' href='chapter1.html'"; # forward
      __link "rev='next' href='chapter3.html'"; # backward
    head_
    
  • Base

    URL (Universal Resource Locator) may be absolute, relative, and internal. Absolute URL has the full path. Relative URL has only relative path that will be resolved according to the base address. The internal URL in the document starts with the '#' character followed by a string that is an id value of a command or a name value of _a command.

    _base command specifies a document's URL explicitly. Its default value is the current document.

    absolute URL:   http://www.neatware.com/dest.html#one
    relative URL:   dest.html#one
    internal URL:   #one