tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From schu...@apache.org
Subject svn commit: r1371336 - in /tomcat/trunk/webapps/docs: config/context.xml tomcat-docs.xsl
Date Thu, 09 Aug 2012 17:44:02 GMT
Author: schultz
Date: Thu Aug  9 17:44:01 2012
New Revision: 1371336

URL: http://svn.apache.org/viewvc?rev=1371336&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53653
Allow for wrapped source code example in config/context.html

Modified:
    tomcat/trunk/webapps/docs/config/context.xml
    tomcat/trunk/webapps/docs/tomcat-docs.xsl

Modified: tomcat/trunk/webapps/docs/config/context.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/context.xml?rev=1371336&r1=1371335&r2=1371336&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/context.xml (original)
+++ tomcat/trunk/webapps/docs/config/context.xml Thu Aug  9 17:44:01 2012
@@ -1339,18 +1339,25 @@ mywebapp/
                 classes/
 </source>
     <p>The configuration is:</p>
-<source>
+
+<source wrapped="true">
 &lt;Context path="/mywebapp" docBase="/Users/theuser/mywebapp/src/main/webapp" >
+<indent>
   &lt;Resources className="org.apache.naming.resources.VirtualDirContext"
-    extraResourcePaths=
-    "/WEB-INF/classes=/Users/theuser/mywebapp/target/classes,/pictures=/Users/theuser/mypictures,/movies=/Users/theuser/mymovies"
/>
+    <indent><outdent>extraResourcePaths="/WEB-INF/classes=/Users/theuser/mywebapp/target/classes,/pictures=/Users/theuser/mypictures,/movies=/Users/theuser/mymovies"</outdent></indent>
+    <indent>/></indent>
+</indent>
+<indent>
   &lt;Loader className="org.apache.catalina.loader.VirtualWebappLoader"
-    virtualClasspath="/Users/theuser/mywebapp/target/classes;
-      /Users/theuser/mylib/target/classes;
-      /Users/theuser/.m2/repository/log4j/log4j/1.2.15/log4j-1.2.15.jar" />
+    <indent><outdent>virtualClasspath="/Users/theuser/mywebapp/target/classes;/Users/theuser/mylib/target/classes;/Users/theuser/.m2/repository/log4j/log4j/1.2.15/log4j-1.2.15.jar"</outdent></indent>
+    <indent>/></indent>
+</indent>
+<indent>
   &lt;JarScanner scanAllDirectories="true" />
+</indent>
 &lt;/Context>
 </source>
+
     <p>Note that resources in mylib/target/classes/META-INF/resources/ are mapped to
/ as
     required by servlet 3 specification.</p>
   </subsection>

Modified: tomcat/trunk/webapps/docs/tomcat-docs.xsl
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/tomcat-docs.xsl?rev=1371336&r1=1371335&r2=1371336&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/tomcat-docs.xsl (original)
+++ tomcat/trunk/webapps/docs/tomcat-docs.xsl Thu Aug  9 17:44:01 2012
@@ -87,6 +87,11 @@
             code {background-color:rgb(224,255,255);padding:0 0.1em;}
             code.attributeName, code.propertyName {background-color:transparent;}
         </style>
+        <style type="text/css">
+            .wrapped-source code { display: block; background-color: transparent; }
+            .wrapped-source div { margin: 0 0 0 1.25em; }
+            .wrapped-source p { margin: 0 0 0 1.25em; text-indent: -1.25em; }
+        </style>
     </head>
 
     <body bgcolor="{$body-bg}" text="{$body-fg}" link="{$body-link}"
@@ -326,9 +331,22 @@
           <td bgcolor="{$source-color}" width="1">
             <img src="{$void}" alt="" width="1" height="1" vspace="0" hspace="0" border="0"/>
           </td>
+    <xsl:choose>
+      <xsl:when test="@wrapped='true'">
+          <td bgcolor="#ffffff" height="1">
+            <div class="wrapped-source">
+            <code>
+              <xsl:apply-templates />
+            </code>
+            </div>
+          </td>
+      </xsl:when>
+      <xsl:otherwise>
           <td bgcolor="#ffffff" height="1"><pre>
             <xsl:value-of select="."/>
           </pre></td>
+      </xsl:otherwise>
+    </xsl:choose>
           <td bgcolor="{$source-color}" width="1">
             <img src="{$void}" alt="" width="1" height="1" vspace="0" hspace="0" border="0"/>
           </td>
@@ -349,6 +367,18 @@
   </xsl:template>
 
 
+  <!-- Process a wrapped source code example - indent -->
+  <xsl:template match="source//indent">
+    <div><xsl:apply-templates /></div>
+  </xsl:template>
+
+
+  <!-- Process a wrapped source code example - outdent -->
+  <xsl:template match="source//outdent">
+    <p><xsl:apply-templates /></p>
+  </xsl:template>
+
+
   <!-- Process an attributes list with nested attribute elements -->
   <xsl:template match="attributes">
     <table border="1" cellpadding="5">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message