Author: wglass
Date: Wed Jul 13 09:52:55 2005
New Revision: 216183
URL: http://svn.apache.org/viewcvs?rev=216183&view=rev
Log:
fixed width and spacing issues, particularly for source code
Modified:
jakarta/velocity/core/trunk/xdocs/.htaccess
jakarta/velocity/core/trunk/xdocs/docs/anakia.xml
jakarta/velocity/core/trunk/xdocs/docs/developer-guide.xml
jakarta/velocity/core/trunk/xdocs/docs/license.xml
jakarta/velocity/core/trunk/xdocs/docs/texen.xml
jakarta/velocity/core/trunk/xdocs/docs/user-guide.xml
jakarta/velocity/core/trunk/xdocs/readme.txt
jakarta/velocity/core/trunk/xdocs/site.css
jakarta/velocity/core/trunk/xdocs/stylesheets/site.vsl
Modified: jakarta/velocity/core/trunk/xdocs/.htaccess
URL:
http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/.htaccess?rev=216183&r1=216182&r2=216183&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/.htaccess (original)
+++ jakarta/velocity/core/trunk/xdocs/.htaccess Wed Jul 13 09:52:55 2005
@@ -23,5 +23,8 @@
RewriteRule ^docs14$ velocity/docs14/user-guide.html
RewriteRule ^docs14/$ velocity/docs14/user-guide.html
+RewriteRule ^docs$ velocity/docs14/user-guide.html
+RewriteRule ^docs/$ velocity/docs14/user-guide.html
+
RewriteRule ^api$ velocity/docs14/api
RewriteRule ^api/(.*/)$ velocity/docs14/api/\1
Modified: jakarta/velocity/core/trunk/xdocs/docs/anakia.xml
URL:
http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/docs/anakia.xml?rev=216183&r1=216182&r2=216183&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/docs/anakia.xml (original)
+++ jakarta/velocity/core/trunk/xdocs/docs/anakia.xml Wed Jul 13 09:52:55 2005
@@ -22,8 +22,10 @@
<p>
The basic model that AnakiaTask uses is pretty straightforward :
<ol>
- <li>Parse your XML into a JDOM Document:<br/>
-<pre>SAXBuilder builder;
+ <li>Parse your XML into a JDOM Document:
+
+<source><![CDATA[
+SAXBuilder builder;
Document root = null;
try
@@ -32,13 +34,19 @@
"org.apache.xerces.parsers.SAXParser" );
root = builder.build( file );
}
-catch( Exception )
+catch( Exception E )
{
System.out.println( ... );
-}</pre></li>
+}
+]]></source>
+
+</li>
<li>Stuff the Document (or root Element) into the context:<br/>
-<pre>context.put("root", root );</pre></li>
+<source><![CDATA[
+context.put("root", root );
+]]></source>
+</li>
<li>Render a template using Velocity. Within the template, one
can use JDOM's methods to access the data contained in the
@@ -128,15 +136,18 @@
property="AnakiaTask.present"/>
</target>
- <target depends="prepare" name="prepare-error" unless="AnakiaTask.present">
+ <target depends="prepare" name="prepare-error"
+ unless="AnakiaTask.present">
<echo>
AnakiaTask is not present! Please check to make sure that
velocity.jar is in your classpath.
</echo>
</target>
- <target name="docs" depends="prepare-error" if="AnakiaTask.present">
- <taskdef name="anakia"
classname="org.apache.velocity.anakia.AnakiaTask"/>
+ <target name="docs" depends="prepare-error"
+ if="AnakiaTask.present">
+ <taskdef name="anakia"
+ classname="org.apache.velocity.anakia.AnakiaTask"/>
<anakia basedir="${docs.src}" destdir="${docs.dest}/"
extension=".html" style="./site.vsl"
projectFile="./stylesheets/project.xml"
@@ -396,13 +407,13 @@
<source><![CDATA[
#set ($customMenus = $xpath.applyTo("body/menu",$customContext))
#foreach($customMenu in $customMenus)
- <strong>$customMenu.getAttributeValue("name")</strong>
- <ul>
- #foreach ($customItem in $customMenu.getChildren() )
- #set ($name = $customItem.getAttributeValue("name"))
- <li>#projectanchor($name $customItem.getAttributeValue("href"))</li>
- #end
- </ul>
+ <strong>$customMenu.getAttributeValue("name")</strong>
+ <ul>
+ #foreach ($customItem in $customMenu.getChildren() )
+ #set ($name = $customItem.getAttributeValue("name"))
+ <li>#projectanchor($name $customItem.getAttributeValue("href"))</li>
+ #end
+ </ul>
#end]]></source>
</section>
Modified: jakarta/velocity/core/trunk/xdocs/docs/developer-guide.xml
URL:
http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/docs/developer-guide.xml?rev=216183&r1=216182&r2=216183&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/docs/developer-guide.xml (original)
+++ jakarta/velocity/core/trunk/xdocs/docs/developer-guide.xml Wed Jul 13
09:52:55 2005
@@ -1720,64 +1720,66 @@
...
-public class Test implements ReferenceInsertionEventHandler,
- NullSetEventHandler,
- MethodExceptionEventHandler
+public class Test implements
+ ReferenceInsertionEventHandler,
+ NullSetEventHandler,
+ MethodExceptionEventHandler
{
- public void myTest()
- {
- ....
+ public void myTest()
+ {
+ ....
- /*
- * now, it's assumed that Test implements the correct methods to
- * support the event handler interfaces. So to use them, first
- * make a new cartridge
- */
- EventCartridge ec = new EventCartridge();
-
- /*
- * then register this class as it contains the handlers
- */
- ec.addEventHandler(this);
-
- /*
- * and then finally let it attach itself to the context
- */
- ec.attachToContext( context );
-
- /*
- * now merge your template with the context as you normally
- * do
- */
+ /*
+ * now, it's assumed that Test implements the correct methods
+ * to support the event handler interfaces. So to use them,
+ * first make a new cartridge
+ */
+ EventCartridge ec = new EventCartridge();
- ....
- }
+ /*
+ * then register this class as it contains the handlers
+ */
+ ec.addEventHandler(this);
/*
- * and now the implementations of the event handlers
+ * and then finally let it attach itself to the context
*/
- public Object referenceInsert( String reference, Object value )
- {
- /* do something with it */
- return value;
- }
+ ec.attachToContext( context );
- public boolean shouldLogOnNullSet( String lhs, String rhs )
- {
- if ( /* whatever rule */ )
- return false;
+ /*
+ * now merge your template with the context as you normally
+ * do
+ */
- return true;
- }
+ ....
+ }
- public Object methodException( Class claz, String method, Exception e )
- throws Exception
- {
- if ( /* whatever rule */ )
- return "I should have thrown";
+ /*
+ * and now the implementations of the event handlers
+ */
+ public Object referenceInsert( String reference, Object value )
+ {
+ /* do something with it */
+ return value;
+ }
+
+ public boolean shouldLogOnNullSet( String lhs, String rhs )
+ {
+ if ( /* whatever rule */ )
+ return false;
+
+ return true;
+ }
+
+ public Object methodException( Class claz, String method,
+ Exception e )
+ throws Exception
+ {
+ if ( /* whatever rule */ )
+ return "I should have thrown";
- throw e;
- }
+ throw e;
+ }
}
]]></source>
@@ -2268,37 +2270,38 @@
public class Log4jCategoryExample
{
- public static String CATEGORY_NAME = "velexample";
+ public static String CATEGORY_NAME = "velexample";
- public static void main( String args[] )
- throws Exception
- {
- /*
- * configure log4j to log to console
- */
+ public static void main( String args[] )
+ throws Exception
+ {
+ /*
+ * configure log4j to log to console
+ */
- BasicConfigurator.configure();
+ BasicConfigurator.configure();
- Category log = Category.getInstance( CATEGORY_NAME );
+ Category log = Category.getInstance( CATEGORY_NAME );
- log.info("Hello from Log4jCategoryExample - ready to start velocity");
+ log.info("Log4jCategoryExample: ready to start velocity");
- /*
- * now create a new VelocityEngine instance, and
- * configure it to use the category
- */
+ /*
+ * now create a new VelocityEngine instance, and
+ * configure it to use the category
+ */
- VelocityEngine ve = new VelocityEngine();
+ VelocityEngine ve = new VelocityEngine();
- ve.setProperty( RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
- "org.apache.velocity.runtime.log.SimpleLog4JLogSystem" );
+ ve.setProperty( RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
+ "org.apache.velocity.runtime.log.SimpleLog4JLogSystem" );
- ve.setProperty("runtime.log.logsystem.log4j.category", CATEGORY_NAME);
+ ve.setProperty("runtime.log.logsystem.log4j.category",
+ CATEGORY_NAME);
- ve.init();
+ ve.init();
- log.info("this should follow the initialization output from velocity");
- }
+ log.info("follows initialization output from velocity");
+ }
}
]]></source>
@@ -2327,43 +2330,43 @@
...
- public MyClass()
- {
- ...
+ public MyClass()
+ {
+ ...
- try
- {
- /*
- * register this class as a logger
- */
- Velocity.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM, this );
- Velocity.init();
- }
- catch (Exception e)
- {
- /*
- * do something
- */
- }
- }
-
- /**
- * This init() will be invoked once by the LogManager
- * to give you current RuntimeServices intance
- */
- public void init( RuntimeServices rsvc )
+ try
{
- // do nothing
+ /*
+ * register this class as a logger
+ */
+ Velocity.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM, this );
+ Velocity.init();
}
-
- /**
- * This is the method that you implement for Velocity to call
- * with log messages.
- */
- public void logVelocityMessage(int level, String message)
+ catch (Exception e)
{
- /* do something useful */
+ /*
+ * do something
+ */
}
+ }
+
+ /**
+ * This init() will be invoked once by the LogManager
+ * to give you current RuntimeServices intance
+ */
+ public void init( RuntimeServices rsvc )
+ {
+ // do nothing
+ }
+
+ /**
+ * This is the method that you implement for Velocity to
+ * call with log messages.
+ */
+ public void logVelocityMessage(int level, String message)
+ {
+ /* do something useful */
+ }
...
}
]]></source>
@@ -2783,7 +2786,8 @@
<html>
<body>
The document title is
-
$root.getChild("document").getChild("properties").getChild("title").getText()
+ $root.getChild("document").getChild("properties")
+ .getChild("title").getText()
</body>
</html>
]]></source>
Modified: jakarta/velocity/core/trunk/xdocs/docs/license.xml
URL:
http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/docs/license.xml?rev=216183&r1=216182&r2=216183&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/docs/license.xml (original)
+++ jakarta/velocity/core/trunk/xdocs/docs/license.xml Wed Jul 13 09:52:55 2005
@@ -10,23 +10,27 @@
<body>
<section name="Apache Software License">
-<source test=""><![CDATA[
-/*
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- ]]></source>
+<div class="license">
+
+<p>Copyright 2000-2004 The Apache Software Foundation.
+</p>
+
+<p>Licensed under the Apache License, Version 2.0 (the "License")
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+</p>
+
+<p><a
href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a></p>
+
+<p>
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+</p>
+
+ </div>
</section>
</body>
Modified: jakarta/velocity/core/trunk/xdocs/docs/texen.xml
URL:
http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/docs/texen.xml?rev=216183&r1=216182&r2=216183&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/docs/texen.xml (original)
+++ jakarta/velocity/core/trunk/xdocs/docs/texen.xml Wed Jul 13 09:52:55 2005
@@ -42,7 +42,7 @@
</p>
<p>
-<em>Ant Build File</em>
+<strong>Ant Build File</strong>
</p>
<source><![CDATA[
@@ -50,12 +50,12 @@
<taskdef name="texen" classname="org.apache.velocity.texen.ant.TexenTask"/>
- <!-- ================================================================ -->
- <!-- G E N E R A T E H T M L P A G E S -->
- <!-- ================================================================ -->
- <!-- This target will generate a set of HTML pages based on -->
- <!-- the information in our control context. -->
- <!-- ================================================================ -->
+ <!-- ============================================================= -->
+ <!-- G E N E R A T E H T M L P A G E S -->
+ <!-- ============================================================= -->
+ <!-- This target will generate a set of HTML pages based on -->
+ <!-- the information in our control context. -->
+ <!-- ============================================================= -->
<target name="main">
@@ -78,7 +78,7 @@
]]></source>
<p>
-<em>Control Template</em>
+<strong>Control Template</strong>
</p>
<source><![CDATA[
@@ -102,7 +102,7 @@
]]></source>
<p>
-<em>Worker Template</em>
+<strong>Worker Template</strong>
</p>
<source><![CDATA[
Modified: jakarta/velocity/core/trunk/xdocs/docs/user-guide.xml
URL:
http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/docs/user-guide.xml?rev=216183&r1=216182&r2=216183&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/docs/user-guide.xml (original)
+++ jakarta/velocity/core/trunk/xdocs/docs/user-guide.xml Wed Jul 13 09:52:55
2005
@@ -342,10 +342,10 @@
<source><![CDATA[
This text is visible. ## This text is not.
This text is visible.
-This text is visible. #* This text, as part of a multi-line comment,
-is not visible. This text is not visible; it is also part of the
-multi-line comment. This text still not visible. *# This text is outside
-the comment, so it is visible.
+This text is visible. #* This text, as part of a multi-line
+comment, is not visible. This text is not visible; it is also
+part of the multi-line comment. This text still not
+visible. *# This text is outside the comment, so it is visible.
## This text is not visible.
]]></source>
@@ -1833,7 +1833,7 @@
</p>
<source><![CDATA[
-Send me #set($foo = ["$10 and ","a cake"])#foreach($a in $foo)$a #end please.
+Send #set($foo = ["$10 and ","a pie"])#foreach($a in $foo)$a#end please.
]]></source>
<p>
@@ -1843,7 +1843,7 @@
<source><![CDATA[
Send me
-#set( $foo = ["$10 and ","a cake"] )
+#set( $foo = ["$10 and ","a pie"] )
#foreach( $a in $foo )
$a
#end
@@ -1856,7 +1856,7 @@
<source><![CDATA[
Send me
-#set($foo = ["$10 and ","a cake"])
+#set($foo = ["$10 and ","a pie"])
#foreach ($a in $foo )$a
#end please.
]]></source>
Modified: jakarta/velocity/core/trunk/xdocs/readme.txt
URL:
http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/readme.txt?rev=216183&r1=216182&r2=216183&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/readme.txt (original)
+++ jakarta/velocity/core/trunk/xdocs/readme.txt Wed Jul 13 09:52:55 2005
@@ -30,4 +30,7 @@
point to the latest file, while on the webserver it will be forwarded
to docs14/user-guide.html.
+Finally, note that (for compatibility with old links) links to all old
+product doc URLs still work (rewritten with .htaccess to go to the new
+folder).
Modified: jakarta/velocity/core/trunk/xdocs/site.css
URL:
http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/site.css?rev=216183&r1=216182&r2=216183&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/site.css (original)
+++ jakarta/velocity/core/trunk/xdocs/site.css Wed Jul 13 09:52:55 2005
@@ -182,13 +182,13 @@
padding-bottom:4px;
padding-top:5px;
- width:575px;
+ width:600;
border: 1px solid #333333;
background-color: #EEEEEE;
color: #333333;
- /** puts a space before or after the block in IE and FireFox **/
+ /** bug: puts a extra line before the block in IE and after the block
in FireFox **/
white-space: pre;
font-family: Courier;
@@ -199,6 +199,19 @@
}
+div.license {
+ margin-left:0px;
+ margin-top:20px;
+ margin-bottom:20px;
+ padding:5px;
+
+ border: 1px solid #333333;
+ background-color: #EEEEEE;
+ color: #333333;
+
+ text-align: left;
+}
+
/** define menu styles **/
div.menusection {
@@ -229,8 +242,10 @@
}
@media print {
- div#container {
+ /** make sure this fits the page **/
+ div#container {
+ width:100%;
min-height:0px;
}
@@ -247,6 +262,21 @@
margin-left:5px;
}
+
+ div.source {
+ width:95%;
+ margin-left:0px;
+ }
+
+ /** make a bit more room on the page **/
+ div.section {
+ margin-left: 0px;
+ }
+
+ div.subsection {
+ margin-left: 0px;
+ }
+
h1 {
background-color: #FFFFFF;
color: #000000;
Modified: jakarta/velocity/core/trunk/xdocs/stylesheets/site.vsl
URL:
http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/stylesheets/site.vsl?rev=216183&r1=216182&r2=216183&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/stylesheets/site.vsl (original)
+++ jakarta/velocity/core/trunk/xdocs/stylesheets/site.vsl Wed Jul 13 09:52:55
2005
@@ -244,6 +244,13 @@
#end
<title>$project.getChild("title").getText() -
$root.getChild("properties").getChild("title").getText()</title>
+
+ ## use an absolute CSS for when the URL is rewritten on
the site
+ ## from /velocity/anakia.html to
/velocity/docs/anakia.html
+ <link rel="stylesheet"
href="http://jakarta.apache.org/velocity/site.css" type="text/css">
+
+ ## use a relative CSS for when the page is displayed
locally (will overwrite
+ ## previous CSS settings)
<link rel="stylesheet" href="${relativePath}/site.css"
type="text/css">
</head>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]