]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Resource/Render.hs
Record before big change
[Rakka.git] / Rakka / Resource / Render.hs
index 66a1516df6f8b1ef2a09ba58dcac441c036baefd..bcfd17f209f48cb526a8252247fa07c3e47f11f2 100644 (file)
@@ -70,7 +70,7 @@ handleRedirect env
 
 {-
   <page site="CieloNegro"
-        styleSheet="http://example.org/object/StyleSheet/Default"
+        baseURI="http://example.org"
         name="Foo/Bar"
         type="text/x-rakka"
         lang="ja"            -- 存在しない場合もある
@@ -82,6 +82,14 @@ handleRedirect env
         revision="112">      -- デフォルトでない場合のみ存在
         lastModified="2000-01-01T00:00:00">
 
+    <styleSheets>
+      <styleSheet src="http://example.org/object/StyleSheet/Default" />
+    </styleSheets>
+
+    <scripts>
+      <script src="http://example.org/js" />
+    </scripts>
+
     <summary>
         blah blah...
     </summary> -- 存在しない場合もある
@@ -106,6 +114,10 @@ handleRedirect env
     <body>
       blah blah...
     </body>
+
+    <source><!-- isBinary="no" の場合にのみ存在 -->
+      blah blah...
+    </source>
   </page>
 -}
 handleGetEntity :: (ArrowXml a, ArrowChoice a, ArrowIO a) => Environment -> a Page (Resource ())
@@ -143,11 +155,20 @@ entityToXHTML
                      += txt " - "
                      += getXPathTreesInDoc "/page/@name/text()"
                    )
-                += ( eelem "link"
+                += ( getXPathTreesInDoc "/page/styleSheets/styleSheet"
+                     >>>
+                     eelem "link"
                      += sattr "rel"  "stylesheet"
                      += sattr "type" "text/css"
                      += attr "href"
-                            ( getXPathTreesInDoc "/page/@styleSheet/text()" )
+                            ( getXPathTrees "/styleSheet/@src/text()" )
+                   )
+                += ( getXPathTreesInDoc "/page/scripts/script"
+                     >>>
+                     eelem "script"
+                     += sattr "type" "text/javascript"
+                     += attr "src"
+                            ( getXPathTrees "/script/@src/text()" )
                    )
               )
            += ( eelem "body"
@@ -190,9 +211,17 @@ entityToXHTML
 
 {-
   <pageNotFound site="CieloNegro"
-                styleSheet="http://example.org/object/StyleSheet/Default"
+                baseURI="http://example.org"
                 name="Foo/Bar">
 
+    <styleSheets>
+      <styleSheet src="http://example.org/object/StyleSheet/Default" />
+    </styleSheets>
+
+    <scripts>
+      <script src="http://example.org/js" />
+    </scripts>
+
     <pageTitle>
       blah blah...
     </pageTitle>
@@ -226,11 +255,20 @@ notFoundToXHTML
                      += txt " - "
                      += getXPathTreesInDoc "/pageNotFound/@name/text()"
                    )
-                += ( eelem "link"
+                += ( getXPathTreesInDoc "/pageNotFound/styleSheets/styleSheet"
+                     >>>
+                     eelem "link"
                      += sattr "rel"  "stylesheet"
                      += sattr "type" "text/css"
                      += attr "href"
-                            ( getXPathTreesInDoc "/pageNotFound/@styleSheet/text()" )
+                            ( getXPathTrees "/styleSheet/@src/text()" )
+                   )
+                += ( getXPathTreesInDoc "/pageNotFound/scripts/script"
+                     >>>
+                     eelem "script"
+                     += sattr "type" "text/javascript"
+                     += attr "src"
+                            ( getXPathTrees "/script/@src/text()" )
                    )
               )
            += ( eelem "body"