diff pspx.html @ 3:c6902cded64d draft

Corrections and reorg.
author David Barts <n5jrn@me.com>
date Mon, 13 May 2019 06:53:08 -0700
parents ca6f8ca38cf2
children 31bb8400e6e3
line wrap: on
line diff
--- a/pspx.html	Sun May 12 22:51:34 2019 -0700
+++ b/pspx.html	Mon May 13 06:53:08 2019 -0700
@@ -18,10 +18,9 @@
       header lines may appear only once in a given file.</p>
     <dl>
       <dt><code>#errors</code></dt>
-      <dd>This is an error page which handles the specified HTTP error codes.
-        The codes are specified in numeric form, separated by whitespace. If no
-        error codes are specified, this page handles all possible HTTP error
-        codes.</dd>
+      <dd>Ignore other headers and make this is an error page which handles
+        the specified HTTP error codes. See the subsection on error pages below.
+      </dd>
       <dt><code>#forward</code></dt>
       <dd>Ignore everything else in this template (and any code-behind
         associated with it), using the specified route to serve it instead. The
@@ -46,7 +45,8 @@
       <dd>The rest of the line is treated as a remark (comment) and is ignored.</dd>
       <dt><code>#template</code></dt>
       <dd>Ignore the body of this file and instead use the template in the body
-        of the specified file, which must end in <span class="kbd">.pspx</span>.</dd>
+        of the specified file, which must end in <span class="kbd">.pspx</span>.
+        Any headers in the referred template file are ignored.</dd>
     </dl>
     <p>It is possible to include whitespace and special characters in arguments
       to the <code>#forward</code>, <code>#python</code>, and <code>#template</code>
@@ -54,7 +54,7 @@
       example, <code>#python "space case.py"</code>.</p>
     <h3>Error Pages</h3>
     <p>Error pages supersede the standard Bottle error handling, and are created
-      by using the <code>#error</code> page header. <em>Error pages have no
+      by using the <code>#errors</code> page header. <em>Error pages have no
         associated code-behind;</em> they consist of templates only. Error page
       templates are provided with two variables when rendering:</p>
     <dl>
@@ -63,7 +63,10 @@
       <dt><code>request</code></dt>
       <dd>The <code>bottle.Request</code> object associated with this error.</dd>
     </dl>
-    <p>The behavior of specifying multiple error pages for the same error code
+    <p>The <code>#errors</code> directive takes a list of numeric error codes
+    (values from 400 to 599 are allowed); the page is created to handle the
+    specified errors. If no error codes are specified, the page will handle all
+    errors. The behavior of specifying multiple error pages for the same error code
     is undefined; doing so is best avoided.</p>
     <h2>The Body</h2>
     <p>The body begins with the first line that <em>does not</em> start with <code>#</code>