Difference between revisions of "S2 Cookbook: A Testbed Layout"
From Dreamwidth Notes
Foxfirefey (Talk | contribs) (Created page with 'This layout is meant to give you a clean testbed to explore examples with. It gives ONLY the barest basics to get a blank HTML page to load, ensuring your test code is at the fo…') |
Foxfirefey (Talk | contribs) m |
||
Line 6: | Line 6: | ||
<syntaxhighlight lang="s2">layerinfo "type" = "layout"; | <syntaxhighlight lang="s2">layerinfo "type" = "layout"; | ||
− | |||
layerinfo "name" = "S2 Testbed Layout"; | layerinfo "name" = "S2 Testbed Layout"; | ||
Line 12: | Line 11: | ||
"This is a skeleton page function, for testing." | "This is a skeleton page function, for testing." | ||
{ | { | ||
− | """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n"""; | + | """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" """; |
+ | """"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n"""; | ||
"""<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n"""; | """<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n"""; | ||
"""<title>S2 Testbed Layout</title>\n"""; | """<title>S2 Testbed Layout</title>\n"""; | ||
Line 23: | Line 23: | ||
"""</html>"""; | """</html>"""; | ||
} | } | ||
− | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 09:20, 17 June 2010
This layout is meant to give you a clean testbed to explore examples with. It gives ONLY the barest basics to get a blank HTML page to load, ensuring your test code is at the forefront of attention. It is NOT a good start to creating a new layout--it's missing key information a functional layout needs. For examples about making layouts, please see S2 Cookbook: Converting a CSS design to a layout.
To use it, make a new layout layer containing the code below, and then a style that uses that layout. If you need more information on how to do that, please see S2 Guide: Style System Overview: Creating and managing layers, as well as the section on creating and managing styles.
S2 Testbed Layout
layerinfo "type" = "layout"; layerinfo "name" = "S2 Testbed Layout"; function Page::print() "This is a skeleton page function, for testing." { """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" """; """"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n"""; """<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n"""; """<title>S2 Testbed Layout</title>\n"""; """</head>"""; """<body>"""; # Code you want to test goes here """</body>"""; """</html>"""; }