Commit 9f65a1e3 authored by Wendell Piez's avatar Wendell Piez

Adjustments to manifesting

parent 4ae8c743
### xpl
#### html-list-promote.xpl
XProc pipeline version 1.0 (4 steps)
Runtime dependency: `mark-lists.xsl`
Runtime dependency: `itemize-lists.xsl`
### xsl
#### itemize-lists.xsl
XSLT stylesheet version 2.0 (2 templates)
#### mark-lists.xsl
XSLT stylesheet version 2.0 (4 templates)
#### PROMOTE-lists.xsl
XSLT stylesheet version 3.0 (4 templates)
Declared dependency: `mark-lists.xsl`
Declared dependency: `itemize-lists.xsl`
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:xsw="http://coko.foundation/xsweet"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0"
type="xsw:html-header-promote" name="html-header-promote">
<p:input port="source" primary="true"/>
<p:input port="parameters" kind="parameter"/>
<p:output port="_0_INPUT" primary="false">
<p:pipe port="result" step="in"/>
</p:output>
<p:output port="_Z_FINAL" primary="true">
<p:pipe port="result" step="final"/>
</p:output>
<p:output port="_A_marked" primary="false">
<p:pipe port="result" step="mark-lists"/>
</p:output>
<p:output port="_B_structured" primary="false">
<p:pipe port="result" step="structure-lists"/>
</p:output>
<p:serialization port="_A_digested" indent="true" omit-xml-declaration="true"/>
<p:serialization port="_B_headers-promoted" indent="true" omit-xml-declaration="true"/>
<p:identity name="in"/>
<p:xslt name="mark-lists">
<p:input port="stylesheet">
<p:document href="mark-lists.xsl"/>
</p:input>
</p:xslt>
<p:xslt name="escalator-xslt">
<p:input port="stylesheet">
<p:document href="itemize-lists.xsl"/>
</p:input>
</p:xslt>
<p:identity name="final"/>
<!--<p:xslt name="">
<p:input port="stylesheet">
<p:inline>
<xsl:stylesheet version="2.0"
xmlns="http://www.w3.org/1999/xhtml"
xpath-default-namespace="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="#all"/>
</p:inline>
</p:input>
</p:xslt>-->
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:xsw="http://coko.foundation/xsweet"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0"
type="xsw:html-header-promote" name="html-header-promote">
<!-- XSweet: XProc implementation of two-step list promotion pipeline. -->
<p:input port="source" primary="true"/>
<p:input port="parameters" kind="parameter"/>
<p:output port="_0_INPUT" primary="false">
<p:pipe port="result" step="in"/>
</p:output>
<p:output port="_Z_FINAL" primary="true">
<p:pipe port="result" step="final"/>
</p:output>
<p:output port="_A_marked" primary="false">
<p:pipe port="result" step="mark-lists"/>
</p:output>
<p:output port="_B_structured" primary="false">
<p:pipe port="result" step="structure-lists"/>
</p:output>
<p:serialization port="_A_marked" indent="true" omit-xml-declaration="true"/>
<p:serialization port="_B_structured" indent="true" omit-xml-declaration="true"/>
<p:identity name="in"/>
<p:xslt name="mark-lists">
<p:input port="stylesheet">
<p:document href="mark-lists.xsl"/>
</p:input>
</p:xslt>
<p:xslt name="structure-lists">
<p:input port="stylesheet">
<p:document href="itemize-lists.xsl"/>
</p:input>
</p:xslt>
<p:identity name="final"/>
<!--<p:xslt name="">
<p:input port="stylesheet">
<p:inline>
<xsl:stylesheet version="2.0"
xmlns="http://www.w3.org/1999/xhtml"
xpath-default-namespace="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="#all"/>
</p:inline>
</p:input>
</p:xslt>-->
</p:declare-step>
\ No newline at end of file
......@@ -14,12 +14,16 @@
<p:output port="HTML" primary="false">
<p:pipe port="result" step="produce-manifest-html"/>
</p:output>
<p:output port="HTML-sorted" primary="false">
<p:pipe port="result" step="organize-manifest"/>
</p:output>
<p:output port="MARKDOWN" primary="true">
<p:pipe port="result" step="render-markdown"/>
</p:output>
<p:serialization port="HTML" method="html" omit-xml-declaration="true" indent="true"/>
<p:serialization port="MARKDOWN" method="text" omit-xml-declaration="true"/>
<p:serialization port="HTML" method="html" omit-xml-declaration="true" indent="true"/>
<p:serialization port="HTML-sorted" method="html" omit-xml-declaration="true" indent="true"/>
<p:serialization port="MARKDOWN" method="text" omit-xml-declaration="true"/>
<p:xslt name="produce-manifest-html">
<p:input port="source">
......@@ -31,6 +35,12 @@
<p:with-param name="dirpath" select="$dirpath"/>
</p:xslt>
<p:xslt name="organize-manifest">
<p:input port="stylesheet">
<p:document href="manifest-reorder.xsl"/>
</p:input>
</p:xslt>
<p:xslt name="render-markdown">
<p:input port="stylesheet">
<p:document href="html-to-markdown.xsl"/>
......
......@@ -30,18 +30,16 @@
<xsl:template match="/" name="go">
<xsl:if test="$dirpath castable as xs:anyURI">
<html>
<body>
<xsl:for-each-group select="file:list($dirpath, true())" group-by="replace(.,'.*\.','')">
<body>
<xsl:for-each-group select="file:list($dirpath, true())" group-by="replace(., '.*\.', '')">
<div>
<h3>{ current-grouping-key() }</h3>
<xsl:apply-templates select="current-group()"/>
</div>
</xsl:for-each-group>
</body>
</html>
</body>
</html>
</xsl:if>
</xsl:template>
<xsl:template match=".">
......@@ -52,15 +50,18 @@
</div>
</xsl:template>
<xsl:template match=".[ends-with(.,'md')]"/>
<xsl:template match=".[ends-with(.,'xsl') or ends-with(.,'xslt') or ends-with(.,'xpl')]">
<xsl:variable name="filepath" select="$dirpath || '/' || ."/>
<div>
<h4>
<xsl:sequence select="."/>
</h4>
<xsl:apply-templates select="document($filepath)/*" mode="report"/>
</div>
<xsl:if test="matches($filepath, '(xml|xpl|sch|xsl|xslt)$')">
<div>
<h4>
<xsl:sequence select="."/>
</h4>
<xsl:apply-templates select="document($filepath)/*" mode="report"/>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="xsl:stylesheet | xsl:transform" mode="report">
......@@ -69,6 +70,17 @@
<xsl:apply-templates mode="#current"/>
</xsl:template>
<xsl:template match="xsl:stylesheet/xsl:param" mode="report">
<p>Runtime parameter <code>{ '`' || @name || '`' }</code> { @as/(' as ' || .) }</p>
<xsl:apply-templates mode="#current"/>
</xsl:template>
<xsl:template match="comment()[matches(.,'^\s*(XSweet|Input|Output|Note):')]" mode="report">
<p>
<xsl:value-of select="normalize-space(.)"/>
</p>
</xsl:template>
<xsl:template match="xsl:include | xsl:import" mode="report">
<p>Compile-time dependency ({ name() }) <code>{ @href }</code></p>
</xsl:template>
......
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:math="http://www.w3.org/2005/xpath-functions/math"
xpath-default-namespace="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xs math"
version="3.0">
<xsl:mode on-no-match="shallow-copy"/>
<xsl:template match="body">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:variable name="divs" select="*"/>
<xsl:variable name="families" select="'xsl','xpl'"/>
<xsl:for-each select="$families">
<xsl:variable name="family" select="."/>
<xsl:apply-templates select="$divs[h3=$family]"/>
</xsl:for-each>
<xsl:apply-templates select="$divs[not(h3=$families)]"/>
</xsl:copy>
</xsl:template>
<xsl:template match="div[h3]">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates select="div[exists(p[starts-with(.,'XSweet')][matches(.,'\[')])]">
<xsl:sort select="p[starts-with(., 'XSweet')] ! replace(., '.*\[', '')"/>
</xsl:apply-templates>
<xsl:apply-templates select="div[empty(p[starts-with(.,'XSweet')][matches(.,'\[')])]"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment