source: project/wiki/eggref/4/doctype @ 37084

Last change on this file since 37084 was 37084, checked in by zbigniew, 4 months ago

Update Chicken 4 docs for zbigniew eggs

These eggs were ported to Chicken 5 and still support
Chicken 4; docs remain synchronized.

atom chickadee chicken-doc chicken-doc-admin doctype
feature-test socket sql-de-lite tcp6 udp6

File size: 3.3 KB
Line 
1[[tags:eggs]]
2
3== doctype
4
5Provides HTML and XHTML doctypes as strings.
6
7[[toc:]]
8
9=== Interface
10
11<constant>doctype-html</constant>
12
13Generic HTML doctype.  Introduced in the HTML5 spec, but is
14backwards-compatible with older browsers, which use it only
15to switch into standards mode.
16
17 <!DOCTYPE HTML>
18
19<constant>doctype-xhtml-1.0-strict</constant><br>
20<constant>doctype-html-4.01-strict</constant><br>
21<constant>doctype-xhtml-1.0-transitional</constant><br>
22<constant>doctype-html-4.01-transitional</constant><br>
23<constant>doctype-xhtml-1.0-frameset</constant><br>
24<constant>doctype-html-4.01-frameset</constant><br>
25<constant>doctype-html-3.2</constant><br>
26<constant>doctype-html-2.0</constant>
27
28Strings corresponding to the "obsolete permitted" HTML and XHTML
29doctypes.  In general it is safe to use {{doctype-html}} instead, as the
30doctype is typically only used to switch browsers into standards mode,
31and all known browsers do this with {{doctype-html}}.
32
33 ;doctype-html-4.01-strict
34 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
35
36<constant>doctype-html-legacy</constant>
37
38Legacy HTML doctype, which should only be emitted by a renderer when
39it cannot produce the shorter {{doctype-html}}.  Don't use this.
40
41 <!DOCTYPE HTML SYSTEM "about:legacy-compat">
42
43<constant>xhtml-1.0-strict</constant><br>
44<constant>html-4.01-strict</constant><br>
45<constant>xhtml-1.0-transitional</constant><br>
46<constant>html-4.01-transitional</constant><br>
47<constant>xhtml-1.0-frameset</constant><br>
48<constant>html-4.01-frameset</constant><br>
49<constant>html-3.2</constant><br>
50<constant>html-2.0</constant>
51
52Aliases for {{doctype-*}}.  Deprecated as of {{doctype}} version 2.0.
53
54<constant>doctype-rules</constant>
55
56A handy ruleset for use with [[sxml-transforms]].  Rules are named like
57the corresponding constants -- for example, {{doctype-html}} -- and will
58output the HTML doctype as a string.
59
60This ruleset contains preorder rules which should be appended/prepended
61to the {{universal-conversion-rules}} because they output raw text which
62should not be processed again.  See the example below.
63
64Note: for compatibility with ''doctype'' egg versions 2.0 and earlier,
65rules without the {{doctype-}} prefix are accepted as well:
66e.g. {{xhtml-1.0-strict}}.  The only exception is {{html}}, which
67conflicts with the {{<html>}} tag.
68
69=== Examples
70
71 #;1> (use doctype)
72 #;2> (print doctype-html)
73 <!DOCTYPE HTML>
74 #;3> (print doctype-xhtml-1.0-strict)
75 <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
76      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
77 #;4> (use sxml-transforms)
78 #;5> (SRV:send-reply
79        (pre-post-order
80         `((doctype-xhtml-1.0-strict)
81           (html (body "blah")))
82          (append doctype-rules universal-conversion-rules)))
83 <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
84      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
85 <html>
86 <body>blah</body></html>
87
88=== About this egg
89
90==== Source
91
92[[https://github.com/ursetto/doctype-egg]]
93
94==== Author
95
96[[http://3e8.org|Jim Ursetto]]
97
98==== Version history
99
100; 2.2 : Add Chicken 5 support
101; 2.1 : Add {{doctype-}} prefixes to doctype-rules; fix bug in html-2.0 rule
102; 2.0 : Add {{doctype-}} prefixes, deprecate old aliases, add {{doctype-html}}
103; 1.2 : Add {{doctype-rules}}
104; 1.1 : Fix typo in html-4.01-transitional
105; 1.0 : Initial release
106
107==== License
108
109Public domain.
110
Note: See TracBrowser for help on using the repository browser.