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.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #*
  2. * Copyright 2003-2004 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. #else
  47. $xmlout.outputString($items)
  48. #end
  49. #end
  50. #end
  51. #macro ( section $section)
  52. <h3 class="section">
  53. <a name="$escape.getText($section.getAttributeValue("name"))"></a>
  54. $section.getAttributeValue("name")
  55. </h3>
  56. #foreach ( $items in $section.getChildren() )
  57. #if ($items.getName().equals("img"))
  58. #image ($items)
  59. #elseif ($items.getName().equals("source"))
  60. #source ($items)
  61. #elseif ($items.getName().equals("table"))
  62. #table ($items)
  63. #elseif ($items.getName().equals("subsection"))
  64. #subsection ($items)
  65. #else
  66. $xmlout.outputString($items)
  67. #end
  68. #end
  69. #end
  70. ## This is where the FAQ specific macro's live
  71. #macro (toc $section)
  72. <h4 class="toc">$section.getAttributeValue("title")</h4>
  73. <ul>
  74. #foreach ($faq in $section.getChildren("faq") )
  75. #subtoc ($faq)
  76. #end
  77. </ul>
  78. #end
  79. #macro (subtoc $faq)
  80. #set ($id = $faq.getAttributeValue("id"))
  81. <li><a href="$pound$id">
  82. $xmlout.outputString($faq.getChild("question"), true)
  83. </a></li>
  84. #end
  85. #macro (answers $section)
  86. #foreach ($faq in $section.getChildren("faq") )
  87. #faq ($faq)
  88. #end
  89. #end
  90. #macro (faq $faq)
  91. #set ($id = $faq.getAttributeValue("id"))
  92. <p class="faq">
  93. <a name="$id"></a>
  94. $xmlout.outputString($faq.getChild("question"), true)
  95. </p>
  96. #foreach ($item in $faq.getChild("answer").getChildren())
  97. #if ($item.getName().equals("img"))
  98. #image ($item)
  99. #elseif ($item.getName().equals("source"))
  100. #source ($item)
  101. #elseif ($item.getName().equals("table"))
  102. #table ($item)
  103. #else
  104. $xmlout.outputString($item)
  105. #end
  106. #end
  107. #end
  108. #macro (document)
  109. #header()
  110. <div class="main">
  111. <div class="content">
  112. <h1 class="title">$root.getChild("properties").getChild("title").getText()</h1>
  113. #set ($allSections = $root.getChild("body").getChildren("section"))
  114. #foreach ( $section in $allSections )
  115. #section ($section)
  116. #end
  117. #if ($root.getChildren("faqsection").size() > 0)
  118. #set ($allFaqSections = $root.getChildren("faqsection"))
  119. <h3 class="section">Questions</h3>
  120. #foreach ( $faqSection in $allFaqSections )
  121. #toc ($faqSection)
  122. #end
  123. <h3 class="section">Answers</h3>
  124. #foreach ( $faqSection in $allFaqSections )
  125. #answers ($faqSection)
  126. #end
  127. #end
  128. </div>
  129. </div>
  130. #footer()
  131. #end