]> gitweb.factorcode.org Git - factor.git/commitdiff
webapps.help: prevent duplicate styles in template
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 10 Jan 2022 18:29:10 +0000 (10:29 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 10 Jan 2022 18:29:10 +0000 (10:29 -0800)
extra/webapps/help/help.factor
extra/webapps/help/help.xml [new file with mode: 0644]
extra/webapps/help/search.xml

index 7f3ebe14decdd30124fbd5138768efee503c9593..1bcff3687aa625a416f60d683dbb795985bdadd1 100644 (file)
@@ -14,6 +14,7 @@ TUPLE: help-webapp < dispatcher ;
 
 :: <search-action> ( help-dir -- action )
     <page-action>
+        { help-webapp "search" } >>template
         [
             "search" param [ unicode:blank? ] trim [
                 help-dir [
@@ -27,7 +28,7 @@ TUPLE: help-webapp < dispatcher ;
             { help-webapp "search" } <chloe-content>
         ] >>display
     <boilerplate>
-        { help-webapp "search" } >>template ;
+        { help-webapp "help" } >>template ;
 
 : help-url ( topic -- url )
     topic>filename "$help-webapp/content/" prepend >url ;
diff --git a/extra/webapps/help/help.xml b/extra/webapps/help/help.xml
new file mode 100644 (file)
index 0000000..4fb5359
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version='1.0' ?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+    <t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
+
+        <head>
+            <meta name="viewport" content="width=device-width, initial-scale=1" />
+
+            <t:write-title />
+
+            <t:style t:include="resource:basis/help/html/stylesheet.css" />
+
+            <t:write-style />
+
+            <t:write-script />
+
+            <t:write-atom />
+        </head>
+
+        <body>
+
+            <div id="container">
+            <t:call-next-template />
+            </div>
+
+        </body>
+
+    </t:chloe>
+
+</html>
index d5c353da89d4a9d729b561366943b4ae7458cc0e..6a0429a9eb2b90c8409e33fa21510ca81653afb7 100644 (file)
@@ -1,59 +1,46 @@
 <?xml version='1.0' ?>
-<!DOCTYPE html>
+
 <t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
 
-<html xmlns="http://www.w3.org/1999/xhtml">
-    <head>
-
-        <t:base t:href="$help-webapp/content/" />
-        <title>Search - Factor Documentation</title>
-        <meta name="viewport" content="width=device-width, initial-scale=1"/>
-        <t:style t:include="resource:basis/help/html/stylesheet.css" />
-        <t:style t:include="resource:extra/webapps/help/search.css" />
-        <t:write-style />
-
-    </head>
-
-    <body>
-    <div id="container">
-        <t:html t:name="navbar"/>
-
-        <div class="page">
-        <t:if t:value="articles">
-            <h2>Articles</h2>
-            <ul>
-                <t:each t:name="articles">
-                    <li> <t:link t:name="value" /> </li>
-                </t:each>
-            </ul>
-        </t:if>
-
-        <t:if t:value="vocabs">
-            <h2>Vocabularies</h2>
-            <ul>
-                <t:each t:name="vocabs">
-                    <li> <t:link t:name="value" /> </li>
-                </t:each>
-            </ul>
-        </t:if>
-
-        <t:if t:value="words">
-            <h2>Words</h2>
-            <ul>
-                <t:each t:name="words">
-                    <li> <t:link t:name="value" /> </li>
-                </t:each>
-            </ul>
-        </t:if>
-
-        <hr />
-        <p>This is the <a href="http://factorcode.org" target="_top">Factor</a>
-        documentation, generated offline from a
-        <code>load-all</code> image. If you want, you can also browse the
-        documentation from within the <a href="http://factorcode.org" target="_top">Factor</a> UI.</p>
-        </div>
+    <t:base t:href="$help-webapp/content/" />
+    <t:title>Search - Factor Documentation />
+    <t:style t:include="resource:extra/webapps/help/search.css" />
+
+    <t:html t:name="navbar"/>
+
+    <div class="page">
+    <t:if t:value="articles">
+        <h2>Articles</h2>
+        <ul>
+            <t:each t:name="articles">
+                <li> <t:link t:name="value" /> </li>
+            </t:each>
+        </ul>
+    </t:if>
+
+    <t:if t:value="vocabs">
+        <h2>Vocabularies</h2>
+        <ul>
+            <t:each t:name="vocabs">
+                <li> <t:link t:name="value" /> </li>
+            </t:each>
+        </ul>
+    </t:if>
+
+    <t:if t:value="words">
+        <h2>Words</h2>
+        <ul>
+            <t:each t:name="words">
+                <li> <t:link t:name="value" /> </li>
+            </t:each>
+        </ul>
+    </t:if>
+
+    <hr />
+    <p>This is the <a href="http://factorcode.org" target="_top">Factor</a>
+    documentation, generated offline from a
+    <code>load-all</code> image. If you want, you can also browse the
+    documentation from within the <a href="http://factorcode.org" target="_top">Factor</a> UI.</p>
     </div>
-    </body>
-</html>
 
 </t:chloe>