]> Lady’s Gitweb - LesML/blobdiff - parser.xslt
Support “comment” paragraphs
[LesML] / parser.xslt
index 7a30b3c621bde2ac6435e37f186f741501f3505c9183975d117cd82b2294d808..489b1e00582879bc6120d5d153bb59ccaa1899542f29b0f12b70fdb9fa2975ee 100644 (file)
@@ -189,6 +189,11 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                <variable name="noshebang" select="$lines[position()>1 or not(starts-with(., '#!lesml') or starts-with(., '##'))]"/>
                <variable name="docsep" select="$noshebang[starts-with(., '#!lesml') or starts-with(., '##')][1]"/>
                <variable name="doclines" select="$noshebang[not($docsep) or following-sibling::*[generate-id()=generate-id($docsep)]]"/>
                <variable name="noshebang" select="$lines[position()>1 or not(starts-with(., '#!lesml') or starts-with(., '##'))]"/>
                <variable name="docsep" select="$noshebang[starts-with(., '#!lesml') or starts-with(., '##')][1]"/>
                <variable name="doclines" select="$noshebang[not($docsep) or following-sibling::*[generate-id()=generate-id($docsep)]]"/>
+               <if test="starts-with($first-line, '##') and $first-line!='##'">
+                       <comment>
+                               <value-of select="substring-after($first-line, '##')"/>
+                       </comment>
+               </if>
                <if test="$shebang!='' or $doclines[normalize-space()!='']">
                        <variable name="record-separators" select="$doclines[starts-with(., '%%')]"/>
                        <html:article>
                <if test="$shebang!='' or $doclines[normalize-space()!='']">
                        <variable name="record-separators" select="$doclines[starts-with(., '%%')]"/>
                        <html:article>
@@ -259,6 +264,11 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                                        </for-each>
                                                                </html:dl>
                                                        </if>
                                                                        </for-each>
                                                                </html:dl>
                                                        </if>
+                                                       <if test=".!='%%'">
+                                                               <comment>
+                                                                       <value-of select="substring-after(., '%%')"/>
+                                                               </comment>
+                                                       </if>
                                                </for-each>
                                        </html:footer>
                                </if>
                                                </for-each>
                                        </html:footer>
                                </if>
@@ -450,6 +460,11 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                                        </html:p>
                                                                </html:div>
                                                        </when>
                                                                        </html:p>
                                                                </html:div>
                                                        </when>
+                                                       <when test="starts-with($text, '# ')">
+                                                               <comment>
+                                                                       <value-of select="substring-after($text, '# ')"/>
+                                                               </comment>
+                                                       </when>
                                                        <otherwise>
                                                                <html:p>
                                                                        <call-template name="LesML:id-and-contents">
                                                        <otherwise>
                                                                <html:p>
                                                                        <call-template name="LesML:id-and-contents">
This page took 0.1586 seconds and 4 git commands to generate.