suve

awful: function: doctype

Declaration

string :doctype ( string $FORMAT )
string :doctype ( int $FORMAT )

Summary

Returns a string containing the W3C doctype appropriate for given file format. Possible input values are:

  • string
    • html5 - returns the HTML5 doctype
    • html4-strict - returns the HTML 4.01 Strict doctype
    • html4-loose - returns the HTML 4.01 Transitional doctype
    • html4-transitional - returns the HTML 4.01 Transitional doctype
    • html4-frameset - returns the HTML 4.01 Frameset doctype
    • xhtml1-strict - returns the XHTML 1.0 Strict doctype
    • xhtml1-transitional - returns the XHTML 1.0 Transitional doctype
    • xhtml1-frameset - returns the XHTML 1.0 Frameset doctype
    • xhtml1-1 - returns the XHTML 1.1 doctype
  • int
    • 5 - HTML5 doctype
    • 4 - HTML 4.01 Transitional doctype
    • 1 - XHTML 1.1 doctype

When given an unrecognized value, or invoked with no arguments altogether, return value defaults to the HTML5 doctype.

Example

# Can be used at the beginning of some CGI script
:writeln :doctype s'html4-loose'
:writeln s'<HTML lang="en">

wikistrona zmodyfikowana 2014/0601/2317