diff --git a/basis/html/components/components-docs.factor b/basis/html/components/components-docs.factor
index 39c17a4708..ce4bddde6a 100644
--- a/basis/html/components/components-docs.factor
+++ b/basis/html/components/components-docs.factor
@@ -1,4 +1,4 @@
-! Copyright (C) 2008 Your name.
+! Copyright (C) 2008 Slava Pestov
! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax io.streams.string kernel strings
urls lcs inspector present io ;
@@ -100,6 +100,6 @@ $nl
{ $subsection farkup }
"Creating custom components:"
{ $subsection render* }
-"Custom components can emit HTML using the " { $vocab-link "html.elements" } " vocabulary." ;
+"Custom components can emit HTML using the " { $vocab-link "xml.literals" } " vocabulary." ;
ABOUT: "html.components"
diff --git a/basis/html/components/components-tests.factor b/basis/html/components/components-tests.factor
index 09bb5860ad..b3ea0319a8 100644
--- a/basis/html/components/components-tests.factor
+++ b/basis/html/components/components-tests.factor
@@ -1,7 +1,8 @@
IN: html.components.tests
USING: tools.test kernel io.streams.string
io.streams.null accessors inspector html.streams
-html.elements html.components html.forms namespaces ;
+html.components html.forms namespaces
+xml.writer ;
[ ] [ begin-form ] unit-test
@@ -163,9 +164,7 @@ M: link-test link-href drop "http://www.apple.com/foo&bar" ;
[ t ] [
[ "object" inspector render ] with-string-writer
- USING: splitting sequences ;
- "\"" split "'" join ! replace " with ' for now
- [ "object" value [ describe ] with-html-writer ] with-string-writer
+ "object" value [ describe ] with-html-writer xml>string
=
] unit-test
diff --git a/basis/html/components/components.factor b/basis/html/components/components.factor
index be197d10e6..40621bc29f 100644
--- a/basis/html/components/components.factor
+++ b/basis/html/components/components.factor
@@ -22,13 +22,6 @@ GENERIC: render* ( value name renderer -- xml )
render* write-xml
[ render-error ] when* ;
- name=<-> type=<->/> XML] ;
-
-PRIVATE>
-
SINGLETON: label
M: label render*
@@ -37,7 +30,7 @@ M: label render*
SINGLETON: hidden
M: hidden render*
- drop "hidden" render-input ;
+ drop [XML name=<-> type="hidden"/> XML] ;
: render-field ( value name size type -- xml )
[XML name=<-> size=<-> type=<->/> XML] ;
@@ -163,9 +156,7 @@ M: farkup render*
SINGLETON: inspector
M: inspector render*
- 2drop [
- [ describe ] with-html-writer
- ] with-string-writer ;
+ 2drop [ describe ] with-html-writer ;
! Diff component
SINGLETON: comparison
diff --git a/basis/html/elements/elements-docs.factor b/basis/html/elements/elements-docs.factor
index 05b202e08e..7f60eca93f 100644
--- a/basis/html/elements/elements-docs.factor
+++ b/basis/html/elements/elements-docs.factor
@@ -20,10 +20,6 @@ $nl
$nl
"Writing unescaped HTML to " { $vocab-link "html.streams" } ":"
{ $subsection write-html }
-{ $subsection print-html }
-"Writing some common HTML patterns:"
-{ $subsection xhtml-preamble }
-{ $subsection simple-page }
-{ $subsection render-error } ;
+{ $subsection print-html } ;
ABOUT: "html.elements"
diff --git a/basis/html/elements/elements.factor b/basis/html/elements/elements.factor
index b0e46984d7..e23d929d6d 100644
--- a/basis/html/elements/elements.factor
+++ b/basis/html/elements/elements.factor
@@ -6,6 +6,14 @@ xml.data xml.literals urls math math.parser combinators
present fry io.streams.string xml.writer html ;
IN: html.elements
+SYMBOL: html
+
+: write-html ( str -- )
+ H{ { html t } } format ;
+
+: print-html ( str -- )
+ write-html "\n" write-html ;
+
<<
: elements-vocab ( -- vocab-name ) "html.elements" ;
diff --git a/basis/html/html.factor b/basis/html/html.factor
index 5469941972..5e86add10e 100644
--- a/basis/html/html.factor
+++ b/basis/html/html.factor
@@ -1,23 +1,10 @@
-! Copyright (C) 2004, 2009 Chris Double, Daniel Ehrenberg.
+! Copyright (C) 2004, 2009 Chris Double, Daniel Ehrenberg,
+! Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: io kernel xml.data xml.writer io.streams.string
-xml.literals io.styles ;
+USING: kernel xml.data xml.writer xml.literals urls.encoding ;
IN: html
-SYMBOL: html
-
-: write-html ( str -- )
- H{ { html t } } format ;
-
-: print-html ( str -- )
- write-html "\n" write-html ;
-
-: xhtml-preamble ( -- )
- "" write-html
- "" write-html ;
-
-: simple-page ( title head-quot body-quot -- )
- [ with-string-writer ] bi@
+: simple-page ( title head body -- xml )
@@ -28,7 +15,10 @@ SYMBOL: html
<->