simple-page ( title head body -- xml )


Vocabulary
html

Inputs
titlea string
headXML data
bodyXML data


Outputs
xmla xml


Word description
Constructs a simple XHTML page with a head and body tag. The given XML data is spliced into the two child tags, and a title is also added to the head tag.

Definition


: simple-page ( title head body -- xml )
3 nenum T{ xml
{ prolog
T{ prolog { version "1.0" } { encoding "UTF-8" } }
}
{ before
V{ T{ doctype-decl { name "html" } } "\n " }
}
{ body
T{ tag
{ name
T{ name
{ space "" }
{ main "html" }
{ url "https://www.w3.org/1999/xhtml" }
}
}
{ attrs T{ attrs { alist ~vector~ } } }
{ children
V{
"\n "
~tag~
"\n "
~tag~
"\n "
}
}
}
}
{ after V{ "" } }
} interpolate-xml <empty-prolog> >>prolog ;