2.1 Generating HTML Strings
(require scribble/html/html) | package: scribble-html-lib |
procedure
(doctype s) → procedure?
s : (or/c string 'html 'xhtml)
> (output-xml (doctype "?")) <!DOCTYPE ?>
> (output-xml (doctype 'html)) <!DOCTYPE html>
> (regexp-split #rx"\n|((?<=\") (?=\"))" (xml->string (doctype 'xhtml)))
'("<?xml version=\"1.0\" encoding=\"utf-8\"?>"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
"")
procedure
(xhtml content ...) → procedure?
content : outputable/c
> (regexp-split #rx"\n|((?<=\") (?=\"))" (xml->string (xhtml "Hello")))
'("<?xml version=\"1.0\" encoding=\"utf-8\"?>"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
"<html xmlns=\"http://www.w3.org/1999/xhtml\">Hello</html>"
"")
> (output-xml (title "The Book")) <title>The Book</title>
procedure
(base v ...) → procedure?
v : outputable/c
procedure
(meta v ...) → procedure?
v : outputable/c
procedure
(link v ...) → procedure?
v : outputable/c
procedure
(hr v ...) → procedure?
v : outputable/c
procedure
(br v ...) → procedure?
v : outputable/c
procedure
(basefont v ...) → procedure?
v : outputable/c
procedure
(param v ...) → procedure?
v : outputable/c
procedure
(img v ...) → procedure?
v : outputable/c
procedure
(area v ...) → procedure?
v : outputable/c
procedure
(input v ...) → procedure?
v : outputable/c
procedure
(isindex v ...) → procedure?
v : outputable/c
procedure
(col v ...) → procedure?
v : outputable/c
> (output-xml (hr)) <hr />
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
> (output-xml nbsp)
procedure
(script/inline v ...) → procedure?
v : outputable/c
> (output-xml (script/inline type: "text/javascript" "var x = 5;"))
<script type="text/javascript">
//<![CDATA[
var x = 5;
//]]>
</script>
procedure
(style/inline v ...) → procedure?
v : outputable/c
> (output-xml (style/inline type: "text/css" ".racket { font-size: xx-large; }"))
<style type="text/css">
.racket { font-size: xx-large; }
</style>