ceki 2004/08/13 02:31:09
Modified: src/xdocs/site bylaws.xml cvs-repositories.xml
logging-site.xml
src/xdocs/stylesheets site.vsl
Log:
Made extensive changes to 'src/xdocs/stylesheets/site.vsl', our site's
velocity style sheet.
- Many of the changes are simlifications resulring from more
aggressive use of CSS. In particular the page layout based on CSS
instead of table hacks.
- The nagigation bar menu is based on CSS. It looks better too.
- The site.vsl velocity style sheet can now generate nice looking FAQ
pages. (Work in progress.)
- Each sub-project can specify its own CSS stylesheet project-wide or
per page.
PR:
Obtained from:
Submitted by:
Reviewed by:
Revision Changes Path
1.7 +3 -3 logging-site/src/xdocs/site/bylaws.xml
Index: bylaws.xml
===================================================================
RCS file: /home/cvs/logging-site/src/xdocs/site/bylaws.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- bylaws.xml 19 Apr 2004 14:18:26 -0000 1.6
+++ bylaws.xml 13 Aug 2004 09:31:09 -0000 1.7
@@ -190,7 +190,7 @@
mail. Voting may take four flavours
</p>
- <table class="regular" cellspacing="1" cellpadding="4">
+ <table class="ls" cellspacing="1" cellpadding="4">
<tr>
<td><strong>+1</strong></td>
<td>"Yes," "Agree," or "the action should be performed." In
@@ -240,7 +240,7 @@
<p>These are the types of approvals that can be sought. Different
actions require different types of approvals</p>
- <table class="regular" valign="top">
+ <table class="ls" valign="top">
<tr>
<td><strong>Consensus</strong></td>
<td>For this to pass, all voters with binding votes must vote and there
@@ -301,7 +301,7 @@
action and those who have binding votes over the action.
</p>
- <table class="regular" cellspacing="1" cellpadding="4">
+ <table class="ls" cellspacing="1" cellpadding="4">
<tr>
<th>Action</th>
<th>Description</th>
1.5 +4 -4 logging-site/src/xdocs/site/cvs-repositories.xml
Index: cvs-repositories.xml
===================================================================
RCS file: /home/cvs/logging-site/src/xdocs/site/cvs-repositories.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- cvs-repositories.xml 22 Jan 2004 20:49:59 -0000 1.4
+++ cvs-repositories.xml 13 Aug 2004 09:31:09 -0000 1.5
@@ -31,14 +31,14 @@
client, configure it appropriatly):
</p>
-<source>
+<pre class="source">
cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic login<br/>
password: anoncvs
-</source>
+</pre>
-<source>
+<pre class="source">
cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic checkout [module-name]
-</source>
+</pre>
<p>
Modules available for access are (click the links to view the CVS tree
1.9 +12 -12 logging-site/src/xdocs/site/logging-site.xml
Index: logging-site.xml
===================================================================
RCS file: /home/cvs/logging-site/src/xdocs/site/logging-site.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- logging-site.xml 27 Jul 2004 20:03:26 -0000 1.8
+++ logging-site.xml 13 Aug 2004 09:31:09 -0000 1.9
@@ -159,22 +159,22 @@
is "next" to your current project directory.
</p>
-<source>
+<pre class="source">
cd /projects
cvs -d /home/cvs login
cvs -d /home/cvs co logging-site
cvs -d /home/cvs co logging-log4j <-- example other project
-</source>
+</pre>
<p>Your directory structure should then look something like this:</p>
-<source>
+<pre class="source">
/projects
/logging-site
/logging-myproject
/logging-log4j
/logging-log4net
-</source>
+</pre>
<h3>How To: From Scratch</h3>
@@ -183,7 +183,7 @@
can be used to store your documentation:
</p>
-<source>
+<pre class="source">
/projects
/logging-myproject/
/build.xml <-- Your Ant build.xml file
@@ -195,7 +195,7 @@
/stylesheets/ <-- This is where your project.xml and
optionally, your style.vsl will go.
/project.xml <-- Your project.xml file. See below.
-</source>
+</pre>
<p>
Copy the <code>project.xml</code> file from the
@@ -215,7 +215,7 @@
to your build file:
</p>
-<source><![CDATA[
+<pre class="source"><![CDATA[
<property name="docs.src" value="./src/xdocs"/>
<property name="docs.dest" value="./docs"/>
@@ -265,13 +265,13 @@
templatePath="${logging-site}/src/xdocs/stylesheets">
</anakia>
</target>
-]]></source>
+]]></pre>
<h2>Constructing your documentation</h2>
<p>Now, in order to build your website, all you need to do is:</p>
- <source>cd logging-myproject
-ant site</source>
+ <pre class="source">cd logging-myproject
+ant site</pre>
<p>
The documentation will then be generated into the
@@ -319,12 +319,12 @@
Once your changes have been checked in, you can do the following:
</p>
-<source>
+<pre class="source">
cd /www/logging.apache.org
cvs update index.html
cd site
cvs update
-</source>
+</pre>
<p>
This will cause the files checked into the
1.10 +115 -172 logging-site/src/xdocs/stylesheets/site.vsl
Index: site.vsl
===================================================================
RCS file: /home/cvs/logging-site/src/xdocs/stylesheets/site.vsl,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- site.vsl 19 Apr 2004 14:18:26 -0000 1.9
+++ site.vsl 13 Aug 2004 09:31:09 -0000 1.10
@@ -10,14 +10,11 @@
#set ($titlebg = "#FFFFFF")
#set ($titlefg = "#2222AA")
-## #set ($bannerbg = "#525D76")
#set ($bannerbg = "#FFFFFF")
#set ($bannerfg = "#2222AA")
#set ($subbannerbg = "#828DA6")
#set ($subbannerfg = "#ffffff")
- #set ($tablethbg = "#039acc")
- #set ($tabletdbg = "#a0ddf0")
<!-- start the processing -->
#document()
@@ -25,72 +22,12 @@
## This is where the macro's live
-#macro ( table $table)
-<table>
- #foreach ( $items in $table.getChildren() )
- #if ($items.getName().equals("tr"))
- #tr ($items)
- #end
- #end
-</table>
-#end
-
-#macro ( tr $tr)
-<tr>
- #foreach ( $items in $tr.getChildren() )
- #if ($items.getName().equals("td"))
- #td ($items)
- #elseif ($items.getName().equals("th"))
- #th ($items)
- #end
- #end
-</tr>
-#end
-
-#macro ( td $value)
-#if ($value.getAttributeValue("colspan"))
-#set ($colspan = $value.getAttributeValue("colspan"))
-#end
-#if ($value.getAttributeValue("rowspan"))
-#set ($rowspan = $value.getAttributeValue("rowspan"))
-#end
-<td bgcolor="$tabletdbg" colspan="$!colspan" rowspan="$!rowspan" valign="top"
align="left">
- <font color="#000000" size="-1" face="arial,helvetica,sanserif">
- #if ($value.getText().length() != 0 || $value.hasChildren())
- $value.getContent()
- #else
-
- #end
- </font>
-</td>
-#end
-
-#macro ( th $value)
-#if ($value.getAttributeValue("colspan"))
-#set ($colspan = $value.getAttributeValue("colspan"))
-#end
-#if ($value.getAttributeValue("rowspan"))
-#set ($rowspan = $value.getAttributeValue("rowspan"))
-#end
-<th bgcolor="$tablethbg" colspan="$!colspan" rowspan="$!rowspan" valign="top"
align="left">
- <font color="#000000" size="-1" face="arial,helvetica,sanserif">
- #if ($value.getText().length() != 0 || $value.hasChildren())
- $value.getContent()
- #else
-
- #end
- </font>
-</th>
-#end
-
#macro ( projectanchor $name $value )
-#if ($value.startsWith("http://"))
- <a href="$value">$name</a>
-## #elseif ($value.startsWith("/site"))
-## <a href="http://logging.apache.org/site/$value">$name</a>
-#else
- <a href="$relativePath$value">$name</a>
-#end
+ #if ($value.startsWith("http://"))
+ <a href="$value">$name</a>
+ #else
+ <a href="$relativePath$value">$name</a>
+ #end
#end
#macro ( metaauthor $author $email )
@@ -111,28 +48,6 @@
<img src="$relativePath$value.getAttributeValue("src")" width="$!width"
height="$!height" align="$!align">
#end
-#macro ( source $value)
- <div align="left">
- <table cellspacing="4" cellpadding="0" border="0">
- <tr>
- <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
- <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
- <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
- </tr>
- <tr>
- <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
- <td bgcolor="#ffffff"><pre>$escape.getText($value.getText())</pre></td>
- <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
- </tr>
- <tr>
- <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
- <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
- <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
- </tr>
- </table>
- </div>
-#end
-
## ============================================
## subsection macro
## ============================================
@@ -143,8 +58,8 @@
#image ($items)
#elseif ($items.getName().equals("source"))
#source ($items)
- #elseif ($items.getName().equals("table"))
- #table ($items)
+ ## #elseif ($items.getName().equals("table"))
+ ## #table ($items)
#else
$items
#end
@@ -168,8 +83,8 @@
#image ($items)
#elseif ($items.getName().equals("source"))
#source ($items)
- #elseif ($items.getName().equals("table"))
- #table ($items)
+ ##elseif ($items.getName().equals("table"))
+ ## #table ($items)
#elseif ($items.getName().equals("subsection"))
#subsection ($items)
#else
@@ -184,25 +99,16 @@
#macro ( makeNavigationBar )
<!-- ============================================================ -->
- <table id="navbar" border="0" cellspacing="0" cellpadding="0">
+ <div class="leftcol">
#set ($menus = $project.getChild("body").getChildren("menu"))
#foreach ( $menu in $menus )
- #if ( $velocityCount != 1 )
-## <tr bgcolor="#999999">
-## <td><html:img page="/images/space2.gif" height="1"></html:img></td>
-## </tr>
- #end
- <tr >
- <td class="navbarHeader" nowrap="true">
- <strong>$menu.getAttributeValue("name")</strong>
- </td>
- </tr>
- #foreach ( $item in $menu.getChildren() )
+ <div class="menu_header">$menu.getAttributeValue("name")</div>
+ #foreach ($item in $menu.getChildren() )
#set ($name = $item.getAttributeValue("name"))
- <tr><td class="navbarItem"><small>#projectanchor($name
$item.getAttributeValue("href"))</small></td></tr>
+ <div class="menu_item">#projectanchor($name
$item.getAttributeValue("href"))</div>
#end
#end
- </table>
+ </div>
#end
@@ -210,33 +116,28 @@
## getProjectImage
## ====================================
#macro (getProjectImage)
+ <div class="banner">
#if ($project.getChild("logo"))
- <td align="left">
- <a href="http://logging.apache.org">
- <img src="http://logging.apache.org/images/ls-logo.jpg" border="0"/></a>
- </td>
- <td align="right">
- #set ( $logoString = $project.getChild("logo").getAttributeValue("href") )
- #if ( $logoString.startsWith("/") )
- <a href="$project.getAttributeValue("href")">
- <img src="$relativePath$logoString"
+ <a href="http://logging.apache.org">
+ <img src="http://logging.apache.org/images/ls-logo.jpg" border="0"/>
+ </a>
+ #set ( $logoString = $project.getChild("logo").getAttributeValue("href") )
+ #if ( $logoString.startsWith("/") )
+ <a href="$project.getAttributeValue("href")">
+ <img style="float: right" src="$relativePath$logoString"
alt="$project.getChild("logo").getText()" border="0"/>
</a>
#else
<a href="$project.getAttributeValue("href")">
- <img src="$relativePath/$logoString"
alt="$project.getChild("logo").getText()" border="0"/>
+ <img style="float: right" src="$relativePath/$logoString"
alt="$project.getChild("logo").getText()" border="0"/>
</a>
#end
- </td>
-
#else
- <td colspan="2">
- <a href="http://logging.apache.org">
+ <a href="http://logging.apache.org">
<img src="http://logging.apache.org/images/ls-logo.jpg" align="left"
border="0"/>
- </a>
- </td>
+ </a>
#end
-
+ </div>
#end
#macro (printMeta $metaElement)
@@ -244,7 +145,59 @@
#foreach ($a in $attribs) $a.getName()="$a.getValue()" #end />
#end
+#macro (faqIndex $root)
+
+ #set( $section = 1 )
+
+ #foreach ( $s in $root.getChild("body").getChildren() )
+ #if ($s.getName().equals("faqSection"))
+ #set( $counter = 1 )
+ <span class="index-faqSection">
+ <a href="#$section">$section. $s.getChild("title").getContent()</a>
+ </span><br/>
+
+ #foreach ( $q in $s.getChildren() )
+ #if ($q.getName().equals("question"))
+ <span class="index-question">
+ <a href="#$section.$counter">Question $section.$counter
$q.getChild("title").getContent()</a>
+ </span></br>
+ #set( $counter = $counter + 1 )
+ #end
+ #end
+ #set( $section = $section + 1 )
+ #end
+ #end
+#end
+
+#macro (faqContents $root)
+ <hr/>
+
+ #set( $section = 1 )
+
+ #foreach ( $s in $root.getChild("body").getChildren() )
+ #if ($s.getName().equals("faqSection"))
+ #set( $counter = 1 )
+ <div class="faqSection">
+ <a name="$section">$section. $s.getChild("title").getContent()</a>
+ </div>
+ #foreach ( $i in $s.getChildren() )
+ #if ($i.getName().equals("question"))
+ <div class="question">
+ <a name="$section.$counter">$section.$counter
$i.getChild("title").getContent()</a>
+ </div>
+ #set( $counter = $counter + 1 )
+ $i.getChild("answer").getContent()
+ #elseif ($i.getName().equals("text"))
+ $i.getContent()
+ #end
+ #end
+ #set( $section = $section + 1 )
+ #end
+ #end
+#end
+
#macro (document)
+ set ($properties = $root.getChild("properties") )
<!-- ====================================================================== -->
<!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
<!-- Main Page Section -->
@@ -253,63 +206,55 @@
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"/>
- #set ($authors = $root.getChild("properties").getChildren("author"))
+ #set ($authors = $properties.getChildren("author"))
#foreach ( $au in $authors )
#metaauthor ( $au.getText() $au.getAttributeValue("email") )
#end
- #set ($metas = $root.getChildren("meta"))
+ #set ($metas = $root.getChildren("meta"))
## Parse meta directives such as
## <meta name="keyword" content="jakarta, java"/>
#foreach ($meta in $metas) #printMeta($meta) #end
## Support for <base> tags.
- #if ($root.getChild("properties").getChild("base"))
- #set ($url =
$root.getChild("properties").getChild("base").getAttributeValue("href"))
+ #if ($properties.getChild("base"))
+ #set ($url = $properties.getChild("base").getAttributeValue("href"))
<base href="$url"/>
#end
<link href="$relativePath/css/site.css" rel="stylesheet"
type="text/css"/>
+ #set ($links = $properties.getChildren("link"))
+ #foreach ( $l in $links )
+ <link href="$l.getAttributeValue("href")" rel="stylesheet"
type="text/css"/>
+ #end
+
- <title>$project.getChild("title").getText() -
$root.getChild("properties").getChild("title").getText()</title>
+ <title>$project.getChild("title").getText() -
$properties.getChild("title").getText()</title>
</head>
<body bgcolor="$bodybg" text="$bodyfg" link="$bodylink">
<!-- START Header table -->
- <table border="0" cellspacing="0" width="90%">
- <!-- TOP IMAGE -->
- <tr>
- #getProjectImage()
- </tr>
- </table>
+ #getProjectImage()
<!-- END Header table -->
- <!-- START main table -->
- <table id="main" border="0" width="90%" cellspacing="2" cellpadding="0">
- <tr><td colspan="2">
- <hr noshade="" size="1"/>
- </td></tr>
-
- <tr>
- <!-- LEFT SIDE NAVIGATION -->
- <td id="navbar" valign="top">
- #makeNavigationBar()
- </td>
- <td id="mainContents" align="left" valign="top">
- #foreach ( $item in $root.getChild("body").getChildren() )
- #if ($item.getName().equals("img"))
- #image ($item)
- #elseif ($item.getName().equals("section"))
- #section ($item)
- #elseif ($item.getName().equals("source"))
- #source ($item)
- #elseif ($item.getName().equals("subsection"))
- #subsection ($item)
- #else
- $item
- #end
- #end
+ <div class="centercol">
+ <hr noshade="" size="1"/>
+
+ #foreach ( $item in $root.getChild("body").getChildren() )
+ #if ($item.getName().equals("img"))
+ #image ($item)
+ #elseif ($item.getName().equals("section"))
+ #section ($item)
+ #elseif ($item.getName().equals("faqSection"))
+ ## do nothing, we'll handle the faq later
+ #else
+ $item
+ #end
+ #end
+
+ #faqIndex ($root)
+ #faqContents ($root)
## #if ($root.getChild("body").getChild("titleSection"))
## #set ($titleSection =
$root.getChild("body").getChild("titleSection"))
@@ -320,20 +265,18 @@
## #foreach ( $section in $allSections )
## #section ($section)
## #end
- </td>
- </tr>
+
<!-- FOOTER -->
- <tr><td colspan="2">
- <hr noshade="" size="1"/>
- </td></tr>
- <tr><td colspan="2">
- <div align="center"><font color="$bodylink" size="-1"><em>
- Copyright © 1999-2004, Apache Software Foundation
- </em></font></div>
- </td></tr>
- </table>
+ <div align="center"><font color="$bodylink" size="-1"><em>
+ Copyright © 1999-2004, Apache Software Foundation
+ </em></font></div>
+
<!-- END main table -->
+
+ <!-- LEFT SIDE NAVIGATION -->
+ #makeNavigationBar()
+
</body>
</html>
#end