((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/doctype" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "eggs")) (section 2 "doctype" (p "Provides HTML and XHTML doctypes as strings.") (toc) (section 3 "Interface" (def (sig (constant "doctype-html" (id doctype-html))) (p "Generic HTML doctype.  Introduced in the HTML5 spec, but is backwards-compatible with older browsers, which use it only to switch into standards mode.") (pre "<!DOCTYPE HTML>")) (def (sig (constant "doctype-xhtml-1.0-strict" (id doctype-xhtml-1.0-strict)) (constant "doctype-html-4.01-strict" (id doctype-html-4.01-strict)) (constant "doctype-xhtml-1.0-transitional" (id doctype-xhtml-1.0-transitional)) (constant "doctype-html-4.01-transitional" (id doctype-html-4.01-transitional)) (constant "doctype-xhtml-1.0-frameset" (id doctype-xhtml-1.0-frameset)) (constant "doctype-html-4.01-frameset" (id doctype-html-4.01-frameset)) (constant "doctype-html-3.2" (id doctype-html-3.2)) (constant "doctype-html-2.0" (id doctype-html-2.0))) (p "Strings corresponding to the \"obsolete permitted\" HTML and XHTML doctypes.  In general it is safe to use " (tt "doctype-html") " instead, as the doctype is typically only used to switch browsers into standards mode, and all known browsers do this with " (tt "doctype-html") ".") (pre ";doctype-html-4.01-strict\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">")) (def (sig (constant "doctype-html-legacy" (id doctype-html-legacy))) (p "Legacy HTML doctype, which should only be emitted by a renderer when it cannot produce the shorter " (tt "doctype-html") ".  Don't use this.") (pre "<!DOCTYPE HTML SYSTEM \"about:legacy-compat\">")) (def (sig (constant "xhtml-1.0-strict" (id xhtml-1.0-strict)) (constant "html-4.01-strict" (id html-4.01-strict)) (constant "xhtml-1.0-transitional" (id xhtml-1.0-transitional)) (constant "html-4.01-transitional" (id html-4.01-transitional)) (constant "xhtml-1.0-frameset" (id xhtml-1.0-frameset)) (constant "html-4.01-frameset" (id html-4.01-frameset)) (constant "html-3.2" (id html-3.2)) (constant "html-2.0" (id html-2.0))) (p "Aliases for " (tt "doctype-*") ".  Deprecated as of " (tt "doctype") " version 2.0.")) (def (sig (constant "doctype-rules" (id doctype-rules))) (p "A handy ruleset for use with " (int-link "sxml-transforms") ".  Rules are named like the corresponding constants -- for example, " (tt "doctype-html") " -- and will output the HTML doctype as a string.") (p "This ruleset contains preorder rules which should be appended/prepended to the " (tt "universal-conversion-rules") " because they output raw text which should not be processed again.  See the example below.") (p "Note: for compatibility with " (i "doctype") " egg versions 2.0 and earlier, rules without the " (tt "doctype-") " prefix are accepted as well: e.g. " (tt "xhtml-1.0-strict") ".  The only exception is " (tt "html") ", which conflicts with the " (tt "<html>") " tag."))) (section 3 "Examples" (pre "#;1> (use doctype)\n#;2> (print doctype-html)\n<!DOCTYPE HTML>\n#;3> (print doctype-xhtml-1.0-strict)\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n     \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n#;4> (use sxml-transforms)\n#;5> (SRV:send-reply\n       (pre-post-order\n        `((doctype-xhtml-1.0-strict)\n          (html (body \"blah\")))\n         (append doctype-rules universal-conversion-rules)))\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n     \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<body>blah</body></html>")) (section 3 "About this egg" (section 4 "Source" (p (link "https://github.com/ursetto/doctype-egg"))) (section 4 "Author" (p (link "http://3e8.org" "Jim Ursetto"))) (section 4 "Version history" (dl (dt "2.2") (dd "Add Chicken 5 support") (dt "2.1") (dd "Add " (tt "doctype-") " prefixes to doctype-rules; fix bug in html-2.0 rule") (dt "2.0") (dd "Add " (tt "doctype-") " prefixes, deprecate old aliases, add " (tt "doctype-html")) (dt "1.2") (dd "Add " (tt "doctype-rules")) (dt "1.1") (dd "Fix typo in html-4.01-transitional") (dt "1.0") (dd "Initial release"))) (section 4 "License" (p "Public domain.")))))