You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

site.vsl 4.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. #*
  2. * Copyright 2001-2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. *#
  17. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  18. ## Content Stylesheet for Site
  19. ## Defined variables
  20. #set ($lightbg = "#ffffff")
  21. #set ($lightfg = "#ffffff")
  22. #set ($darkfg = "#000000")
  23. #set ($active = "#ffcc00")
  24. #set ($blue4 = "#B2C4E0")
  25. #set ($blue3 = "#294563")
  26. #set ($blue2 = "#4C6C8F")
  27. #set ($blue1 = "#CFDCED")
  28. #set ($sourceborder = "#023264")
  29. #set ($pound = "#" )
  30. ## start the processing
  31. #document()
  32. ## end the processing
  33. ## This is where the common page macro's live
  34. #macro ( subsection $subsection)
  35. <h4 class="subsection">
  36. <a name="$escape.getText($subsection.getAttributeValue("name"))"></a>
  37. $subsection.getAttributeValue("name")
  38. </h4>
  39. #foreach ( $items in $subsection.getChildren() )
  40. #if ($items.getName().equals("img"))
  41. #image ($items)
  42. #elseif ($items.getName().equals("source"))
  43. #source ($items)
  44. #elseif ($items.getName().equals("table"))
  45. #table ($items)
  46. #elseif ($items.getName().equals("subsubsection"))
  47. #subsubsection ($items)
  48. #else
  49. $xmlout.outputString($items)
  50. #end
  51. #end
  52. #end
  53. #macro ( subsubsection $subsubsection)
  54. <h5 class="subsection">
  55. <a name="$escape.getText($subsubsection.getAttributeValue("name"))"></a>
  56. *** $subsubsection.getAttributeValue("name") ***
  57. </h5>
  58. #foreach ( $items in $subsubsection.getChildren() )
  59. #if ($items.getName().equals("img"))
  60. #image ($items)
  61. #elseif ($items.getName().equals("source"))
  62. #source ($items)
  63. #elseif ($items.getName().equals("table"))
  64. #table ($items)
  65. #else
  66. $xmlout.outputString($items)
  67. #end
  68. #end
  69. #end
  70. #macro ( section $section)
  71. <h3 class="section">
  72. <a name="$escape.getText($section.getAttributeValue("name"))"></a>
  73. $section.getAttributeValue("name")
  74. </h3>
  75. #foreach ( $items in $section.getChildren() )
  76. #if ($items.getName().equals("img"))
  77. #image ($items)
  78. #elseif ($items.getName().equals("source"))
  79. #source ($items)
  80. #elseif ($items.getName().equals("table"))
  81. #table ($items)
  82. #elseif ($items.getName().equals("subsection"))
  83. #subsection ($items)
  84. #else
  85. $xmlout.outputString($items)
  86. #end
  87. #end
  88. #end
  89. ## This is where the FAQ specific macro's live
  90. #macro (toc $section)
  91. <h4 class="toc">$section.getAttributeValue("title")</h4>
  92. <ul>
  93. #foreach ($faq in $section.getChildren("faq") )
  94. #subtoc ($faq)
  95. #end
  96. </ul>
  97. #end
  98. #macro (subtoc $faq)
  99. #set ($id = $faq.getAttributeValue("id"))
  100. <li><a href="$pound$id">
  101. $xmlout.outputString($faq.getChild("question"), true)
  102. </a></li>
  103. #end
  104. #macro (answers $section)
  105. #foreach ($faq in $section.getChildren("faq") )
  106. #faq ($faq)
  107. #end
  108. #end
  109. #macro (faq $faq)
  110. #set ($id = $faq.getAttributeValue("id"))
  111. <p class="faq">
  112. <a name="$id"></a>
  113. $xmlout.outputString($faq.getChild("question"), true)
  114. </p>
  115. #foreach ($item in $faq.getChild("answer").getChildren())
  116. #if ($item.getName().equals("img"))
  117. #image ($item)
  118. #elseif ($item.getName().equals("source"))
  119. #source ($item)
  120. #elseif ($item.getName().equals("table"))
  121. #table ($item)
  122. #else
  123. $xmlout.outputString($item)
  124. #end
  125. #end
  126. #end
  127. #macro (document)
  128. #header()
  129. <div class="main">
  130. <div class="content">
  131. <h1 class="title">$root.getChild("properties").getChild("title").getText()</h1>
  132. #set ($allSections = $root.getChild("body").getChildren("section"))
  133. #foreach ( $section in $allSections )
  134. #section ($section)
  135. #end
  136. #if ($root.getChildren("faqsection").size() > 0)
  137. #set ($allFaqSections = $root.getChildren("faqsection"))
  138. <h3 class="section">Questions</h3>
  139. #foreach ( $faqSection in $allFaqSections )
  140. #toc ($faqSection)
  141. #end
  142. <h3 class="section">Answers</h3>
  143. #foreach ( $faqSection in $allFaqSections )
  144. #answers ($faqSection)
  145. #end
  146. #end
  147. </div>
  148. </div>
  149. #footer()
  150. #end