]> Lady’s Gitweb - Caudex/commitdiff
Enable manual ordering current 0.3.1
authorLady <redacted>
Sat, 20 Sep 2025 17:53:02 +0000 (13:53 -0400)
committerLady <redacted>
Sat, 20 Sep 2025 17:53:02 +0000 (13:53 -0400)
README.markdown
parser.xslt
transform.xslt

index af420df9f35cc431f70af6358e5254270950c758..14b1424397e8f4e9f2280ebf1f79517997b848f2 100644 (file)
@@ -162,6 +162,12 @@ The following metadata fields are recognized by default :⁠—
 - **`TITLE`:**
   Gives the title of the thing being described.
 
+- **`ORDER`:**
+  Provides a manual ordering of the category or entry.
+  This must be an integer.
+  When multiple categories or entries have the same order, they are
+    then arranged by title.
+
 If the `~` file is missing from a category directory, none of the
   entries in the category will be recognized.
 However, a minimal `~` file will be created for you when you create an
index d20da125c5f23fde826be1ba0874dcc98b8f6d43..61d385d808480570f6e9a883861194431b190508 100644 (file)
@@ -22,6 +22,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
        xmlns:exslstr="http://exslt.org/strings"
        xmlns:foaf="http://xmlns.com/foaf/0.1/"
        xmlns:html="&xhtml;"
+       xmlns:ladys="https://vocab.ladys.computer/terms/"
        xmlns:ore="http://www.openarchives.org/ore/terms/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:skos="http://www.w3.org/2004/02/skos/core#"
@@ -50,6 +51,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                <variable name="identifier" select="exslstr:tokenize($IDENTIFIER, '/')[last()-1]"/>
                <for-each select="html:article">
                        <variable name="title" select="html:footer[@class='head']//html:dt[normalize-space()='TITLE']/following-sibling::html:dd"/>
+                       <variable name="order" select="number(html:footer[@class='head']//html:dt[normalize-space()='ORDER']/following-sibling::html:dd)"/>
                        <element name="awol:Category">
                                <apply-templates select="@lang|@xml:lang"/>
                                <attribute name="rdf:nodeID">
@@ -70,12 +72,21 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                <value-of select="$title"/>
                                        </attribute>
                                </if>
+                               <if test="$order!=number('NaN')">
+                                       <element name="ladys:order">
+                                               <attribute name="rdf:datatype">
+                                                       <text>&xsd;integer</text>
+                                               </attribute>
+                                               <value-of select="$order"/>
+                                       </element>
+                               </if>
                        </element>
                </for-each>
        </template>
        <template match="html:div[html:article/@data-lesml-profile='urn:fdc:ladys.computer:20240204:Caudex:pf:entry']">
                <for-each select="html:article">
                        <variable name="title" select="html:footer[@class='head']//html:dt[normalize-space()='TITLE']/following-sibling::html:dd"/>
+                       <variable name="order" select="number(html:footer[@class='head']//html:dt[normalize-space()='ORDER']/following-sibling::html:dd)"/>
                        <variable name="idstring" select="string(exslstr:tokenize($IDENTIFIER, '/')[last()])"/>
                        <element name="ore:Proxy">
                                <if test="$title">
@@ -88,6 +99,14 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                <value-of select="exslstr:tokenize($IDENTIFIER, '/')[last()-1]"/>
                                        </attribute>
                                </element>
+                               <if test="$order!=number('NaN')">
+                                       <element name="ladys:order">
+                                               <attribute name="rdf:datatype">
+                                                       <text>&xsd;integer</text>
+                                               </attribute>
+                                               <value-of select="$order"/>
+                                       </element>
+                               </if>
                                <element name="skos:notation">
                                        <attribute name="rdf:datatype">
                                                <text>&xsd;string</text>
index a6143634eecf0c39b0b1049f2b0530d9f931a845..9495900a771a96101bc64798b2d2ef67cff5b182 100644 (file)
@@ -23,6 +23,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
        xmlns:exsl="http://exslt.org/common"
        xmlns:exslstr="http://exslt.org/strings"
        xmlns:html="&xhtml;"
+       xmlns:ladys="https://vocab.ladys.computer/terms/"
        xmlns:ore="http://www.openarchives.org/ore/terms/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:skos="http://www.w3.org/2004/02/skos/core#"
@@ -76,6 +77,8 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                        <element name="nav" namespace="&xhtml;">
                                                <element name="ul" namespace="&xhtml;">
                                                        <for-each select="$codex//awol:Category">
+                                                               <sort select="ladys:order" data-type="number"/>
+                                                               <sort select="@awol:term"/>
                                                                <variable name="category-id" select="string(@rdf:nodeID)"/>
                                                                <element name="li" namespace="&xhtml;">
                                                                        <element name="strong" namespace="&xhtml;">
@@ -83,6 +86,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                                        </element>
                                                                        <element name="ul" namespace="&xhtml;">
                                                                                <for-each select="$codex//ore:Proxy[ore:proxyIn/@rdf:nodeID='codex' and awol:category/@rdf:nodeID=$category-id]">
+                                                                                       <sort select="ladys:order" data-type="number"/>
                                                                                        <sort select="@dcterms:title"/>
                                                                                        <sort select="skos:notation"/>
                                                                                        <element name="li" namespace="&xhtml;">
This page took 0.033561 seconds and 4 git commands to generate.