]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/html/templates/templates.factor
html.templates: reverse order of style and scripts
[factor.git] / basis / html / templates / templates.factor
index 3966b1ac83f37c9c4319cfdf16e34c167c273446..89a9921a54121ce7806acf9da416342dcc5fbfc7 100644 (file)
@@ -4,10 +4,6 @@ USING: accessors arrays assocs boxes continuations debugger io
 io.encodings.utf8 io.files io.streams.string kernel namespaces
 prettyprint quotations sequences strings xml.data xml.syntax
 xml.writer ;
-! USING: accessors kernel fry io io.encodings.utf8 io.files
-! debugger prettyprint continuations namespaces boxes sequences
-! arrays strings html io.streams.string assocs
-! quotations xml.data xml.writer xml.syntax ;
 IN: html.templates
 
 MIXIN: template
@@ -54,11 +50,10 @@ SYMBOL: title
 SYMBOL: style
 
 : add-style ( string -- )
-    "\n" style get push-all
-         style get push-all ;
+    style get push ;
 
 : get-style ( -- string )
-    style get >string ;
+    style get <reversed> "\n" join ;
 
 : write-style ( -- )
     get-style write ;
@@ -66,11 +61,10 @@ SYMBOL: style
 SYMBOL: script
 
 : add-script ( string -- )
-    "\n" script get push-all
-         script get push-all ;
+    script get push ;
 
 : get-script ( -- string )
-    script get >string ;
+    script get <reversed> "\n" join ;
 
 : write-script ( -- )
     get-script write ;
@@ -119,8 +113,8 @@ M: f call-template* drop call-next-template ;
 : with-boilerplate ( child master -- )
     [
         title [ [ <box> ] unless* ] change
-        style [ [ SBUF" " clone ] unless* ] change
-        script [ [ SBUF" " clone ] unless* ] change
+        style [ [ V{ } clone ] unless* ] change
+        script [ [ V{ } clone ] unless* ] change
         meta [ [ V{ } clone ] unless* ] change
         atom-feeds [ V{ } like ] change