chloe/html: switch to HTML5 templates
Since XHTML is dead, and HTML5 isn't, switch to HTML5 templates for Chloe and other key parts of our HTML subsystems. As part of this, I went through and added DOCTYPE declarations to some of our examples as well.db4
parent
512014a436
commit
4ef42357e1
|
@ -1,13 +1,17 @@
|
||||||
! Copyright (C) 2004, 2009 Chris Double, Daniel Ehrenberg,
|
! Copyright (C) 2004, 2009 Chris Double, Daniel Ehrenberg,
|
||||||
! Slava Pestov.
|
! Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel xml.data xml.writer xml.syntax urls.encoding ;
|
USING: accessors kernel xml.data xml.writer xml.syntax
|
||||||
|
urls.encoding ;
|
||||||
IN: html
|
IN: html
|
||||||
|
|
||||||
|
TUPLE: empty-prolog < prolog ;
|
||||||
|
M: empty-prolog write-xml drop ;
|
||||||
|
: <empty-prolog> ( -- prolog ) \ empty-prolog new ;
|
||||||
|
|
||||||
: simple-page ( title head body -- xml )
|
: simple-page ( title head body -- xml )
|
||||||
<XML
|
<XML
|
||||||
<?xml version="1.0"?>
|
<!DOCTYPE html>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title><-></title>
|
<title><-></title>
|
||||||
|
@ -15,7 +19,7 @@ IN: html
|
||||||
</head>
|
</head>
|
||||||
<body><-></body>
|
<body><-></body>
|
||||||
</html>
|
</html>
|
||||||
XML> ;
|
XML> <empty-prolog> >>prolog ;
|
||||||
|
|
||||||
: render-error ( message -- xml )
|
: render-error ( message -- xml )
|
||||||
[XML <span class="error"><-></span> XML] ;
|
[XML <span class="error"><-></span> XML] ;
|
||||||
|
|
|
@ -10,7 +10,7 @@ IN: html.templates.chloe.tests
|
||||||
|
|
||||||
: run-template ( quot -- string )
|
: run-template ( quot -- string )
|
||||||
with-string-writer [ "\r\n\t" member? ] reject
|
with-string-writer [ "\r\n\t" member? ] reject
|
||||||
"?>" split1 nip ; inline
|
[ CHAR: \s = ] trim ; inline
|
||||||
|
|
||||||
: test-template ( name -- template )
|
: test-template ( name -- template )
|
||||||
"vocab:html/templates/chloe/test/"
|
"vocab:html/templates/chloe/test/"
|
||||||
|
|
|
@ -176,9 +176,7 @@ ERROR: unknown-chloe-tag tag ;
|
||||||
|
|
||||||
: compile-prologue ( xml -- )
|
: compile-prologue ( xml -- )
|
||||||
[
|
[
|
||||||
[ prolog>> [ write-xml ] [code-with] ]
|
before>> compile-chunk
|
||||||
[ before>> compile-chunk ]
|
|
||||||
bi
|
|
||||||
] compile-quot
|
] compile-quot
|
||||||
[ if-not-nested ] [code] ;
|
[ if-not-nested ] [code] ;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?xml version='1.0' ?>
|
<?xml version='1.0' ?>
|
||||||
|
<!DOCTYPE html>
|
||||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head> <title>Calculator</title> </head>
|
<head> <title>Calculator</title> </head>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?xml version='1.0' ?>
|
<?xml version='1.0' ?>
|
||||||
|
<!DOCTYPE html>
|
||||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<h1><t:label t:name="counter" /></h1>
|
<h1><t:label t:name="counter" /></h1>
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version='1.0' ?>
|
<?xml version='1.0' ?>
|
||||||
|
<!DOCTYPE html>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
|
||||||
|
|
||||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?xml version='1.0' ?>
|
<?xml version='1.0' ?>
|
||||||
|
<!DOCTYPE html>
|
||||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
||||||
<html>
|
<html>
|
||||||
<body>Your IP address is: <t:label t:name="ip" />
|
<body>Your IP address is: <t:label t:name="ip" />
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version='1.0' ?>
|
<?xml version='1.0' ?>
|
||||||
|
<!DOCTYPE html>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
|
|
||||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
<?xml version='1.0' ?>
|
<?xml version='1.0' ?>
|
||||||
|
<!DOCTYPE html>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
|
|
||||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
||||||
|
|
||||||
<t:title>Factor binary package for <t:label t:name="platform" /></t:title>
|
<t:title>Factor binary package for <t:label t:name="platform" /></t:title>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?xml version='1.0' ?>
|
<?xml version='1.0' ?>
|
||||||
|
<!DOCTYPE html>
|
||||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<t:style t:include="resource:extra/webapps/todo/todo.css" />
|
<t:style t:include="resource:extra/webapps/todo/todo.css" />
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version='1.0' ?>
|
<?xml version='1.0' ?>
|
||||||
|
<!DOCTYPE html>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
|
||||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
||||||
|
|
|
@ -3,7 +3,7 @@ webapps.mason.version.data webapps.mason.backend webapps.mason.grids webapps.mas
|
||||||
webapps.mason.utils html.elements html.streams accessors
|
webapps.mason.utils html.elements html.streams accessors
|
||||||
xml.writer xmode.highlight ; %>
|
xml.writer xmode.highlight ; %>
|
||||||
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
|
|
Loading…
Reference in New Issue