incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r448701 - /incubator/public/trunk/site-author/stylesheets/site.vsl
Date Thu, 21 Sep 2006 21:49:26 GMT
Author: rdonkin
Date: Thu Sep 21 14:49:25 2006
New Revision: 448701

URL: http://svn.apache.org/viewvc?view=rev&rev=448701
Log:
Added toc element which prints a table of contents.

Modified:
    incubator/public/trunk/site-author/stylesheets/site.vsl

Modified: incubator/public/trunk/site-author/stylesheets/site.vsl
URL: http://svn.apache.org/viewvc/incubator/public/trunk/site-author/stylesheets/site.vsl?view=diff&rev=448701&r1=448700&r2=448701
==============================================================================
--- incubator/public/trunk/site-author/stylesheets/site.vsl (original)
+++ incubator/public/trunk/site-author/stylesheets/site.vsl Thu Sep 21 14:49:25 2006
@@ -64,6 +64,33 @@
 #end
 ##
 ##
+#macro ( make_toc )
+#set ($allSections = $root.getChild("body").getChildren("section"))
+<ul>
+#foreach ( $section in $allSections )
+<li><a href='#$section.getAttributeValue("id")'>$section.getChild("title").getText()</a>
+<ul>
+#foreach ( $subsection in $section.getChildren("section") )
+<li><a href='#$subsection.getAttributeValue("id")'>$subsection.getChild("title").getText()</a>
+<ul>
+#foreach ( $subsubsection in $subsection.getChildren("section") )
+<li><a href='#$subsubsection.getAttributeValue("id")'>$subsubsection.getChild("title").getText()</a></li>
+<ul>
+#foreach ( $subsubsubsection in $subsubsection.getChildren("section") )
+<li><a href='#$subsubsubsection.getAttributeValue("id")'>$subsubsubsection.getChild("title").getText()</a></li>
+#end
+</ul>
+#end
+</ul>
+</li>
+#end
+</ul>
+</li>
+#end
+</ul>
+#end
+##
+##
 #macro ( metaauthor $author $email )
 <meta name="author" content="$author" /><meta name="email" content="$email" />
 #end
@@ -134,6 +161,8 @@
 #color_table ($items)
 #elseif ($items.getName().equals("note"))
 #make_note ($items)
+#elseif ($items.getName().equals("toc"))
+#make_toc ()
 #elseif ($items.getName().equals("section"))
 ##set ($sublevel = $level + 1)
 #if ($level == 1)



---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message