changeset 607:a8f7b93b0a5f

Allow article sections to be nested.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 26 Jul 2012 11:36:34 +0000
parents cb43695220b2
children 34b0e74528a5
files dtd/content.dtd xsls/body.xsls xsls/content.xsls
diffstat 3 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dtd/content.dtd
+++ b/dtd/content.dtd
@@ -4,7 +4,7 @@
   -->
 
 <!ELEMENT  section      (para | list | book | download | security | note |
-                         programlisting)* >
+                         programlisting | section)* >
 <!ATTLIST  section
            id           ID #IMPLIED
            name         CDATA #IMPLIED
--- a/xsls/body.xsls
+++ b/xsls/body.xsls
@@ -66,6 +66,10 @@ X:template body (lang) {
             <table width="100%"><tr><td align="{$INDEX_ALIGN}">
             X:for-each "section[@id and @name]" {
                 <a href="#{@id}"> !{@name} </a><br/>
+                X:for-each "section[@id and @name]" {
+                    X:text{&#160;&#160;&#160;&#160;&#160;}
+                    <a href="#{@id}"> !{@name} </a><br/>
+                }
                 X:if "@id = 'directives'" {
                     X:for-each "directive[@name]" {
                         X:text{&#160;&#160;&#160;&#160;&#160;}
--- a/xsls/content.xsls
+++ b/xsls/content.xsls
@@ -10,6 +10,11 @@ X:stylesheet {
         !!;
     }
 
+    X:template = "section/section[@id and @name]" {
+        <a name="{@id}" /> <center><h5> !{@name} </h5></center>
+        !!;
+    }
+
     X:template = "section[@id and not(@name)]" {
         <a name="{@id}" />
         !!;
@@ -20,6 +25,11 @@ X:stylesheet {
         !!;
     }
 
+    X:template = "section/section[not(@id) and @name]" {
+        <center><h5> !{@name} </h5></center>
+        !!;
+    }
+
     X:template = "para" { <p> !!; </p> }
 
     X:template = "para[@align]" { <p align="{@align}"> !!; </p> }