Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Improvements to the site #6

Merged
merged 3 commits into from over 2 years ago

2 participants

Michael Osipov Paul Holser
Michael Osipov

Hi Paul,

I've made some more improvements. Probably you have not noticed, the page layout was broken. I fixed a few points.

  • fixed missing CSS, page layout was broken by removing custom (old?) site.vm
  • fixed bannerLeft href to new gitsite
  • logo and publishDate have plausibile defaults, it's fine to go with these
  • download.apt is filtered by the site plugin now
  • reduced example replacement scope to examples.html

NOTE: ExceptionExample exits the JVM with return code 1 which might confuse folks
who build your lib themselves. Might be worth mentioning somewhere.
IDEA: It might be reasonable to spit example output to ${project.build.directory}/examples rather than ${java.io.tmpdir}.

I guess it's fine to bump the version to 4.0.1.

Paul Holser
Owner

Thanks for taking this on!

Paul Holser pholser merged commit 0a31368 into from October 18, 2011
Paul Holser pholser closed this October 18, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
6  paste-examples.xml
... ...
@@ -1,6 +1,4 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2  
-
3  
-<!-- $Id: paste-examples.xml,v 1.11 2009/10/03 23:27:09 pholser Exp $ -->
4 2
 <project>
5 3
     <target name="-paste-examples">
6 4
         <filterchain id="htmlFilter">
@@ -119,9 +117,7 @@
119 117
             srcfile="${java.io.tmpdir}/stack-trace-output.txt">
120 118
             <filterchain refid="htmlFilter"/>
121 119
         </loadfile>
122  
-        <replace dir="${website.staging.dir}" includes="**/*.html">
123  
-            <replacefilter token="@JOPT_SIMPLE_VERSION@"
124  
-                value="${project.version}"/>
  120
+        <replace dir="${website.staging.dir}" includes="examples.html">
125 121
             <replacefilter token="@SHORT_OPTIONS_EXAMPLE@"
126 122
                 value="${short.options.example}"/>
127 123
             <replacefilter token="@SHORT_OPTIONS_WITH_ARGUMENTS_EXAMPLE@"
6  pom.xml
@@ -143,11 +143,10 @@
143 143
                         <phase>post-site</phase>
144 144
                         <configuration>
145 145
                             <tasks>
146  
-                                <property name="project.version" value="${project.version}" />
147 146
                                 <property name="java.io.tmpdir" value="${java.io.tmpdir}" />
148 147
                                 <property name="example.src.dir" value="src/test/java" />
149 148
                                 <property name="example.class.path" refid="maven.test.classpath" />
150  
-                                <property name="website.staging.dir" value="target/site" />
  149
+                                <property name="website.staging.dir" value="${project.build.directory}/site" />
151 150
                                 <ant antfile="paste-examples.xml" target="-paste-examples" />
152 151
                             </tasks>
153 152
                         </configuration>
@@ -160,9 +159,6 @@
160 159
             <plugin>
161 160
                 <artifactId>maven-site-plugin</artifactId>
162 161
                 <version>2.3</version>
163  
-                <configuration>
164  
-                    <templateFile>src/site/site.vm</templateFile>
165  
-                </configuration>
166 162
             </plugin>
167 163
         </plugins>
168 164
     </build>
2  src/site/apt/download.apt → src/site/apt/download.apt.vm
@@ -12,7 +12,7 @@
12 12
   <dependency>
13 13
     <groupId>net.sf.jopt-simple</groupId>
14 14
     <artifactId>jopt-simple</artifactId>
15  
-    <version>@JOPT_SIMPLE_VERSION@</version>
  15
+    <version>${project.version}</version>
16 16
   </dependency>
17 17
   ...
18 18
 </dependencies>
374  src/site/site.vm
... ...
@@ -1,374 +0,0 @@
1  
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2  
-
3  
-#macro ( link $href $name )
4  
-  #if ( ( $href.toLowerCase().startsWith("http") || $href.toLowerCase().startsWith("https") ) )
5  
-    <a href="$href" class="externalLink">$name</a>
6  
-  #else
7  
-    <a href="$href">$name</a>
8  
-  #end
9  
-#end
10  
-
11  
-#macro ( banner $banner $id )
12  
-  #if ( $banner )
13  
-    #if( $banner.href )
14  
-      <a href="$banner.href" id="$id" #if( $banner.alt ) title="$banner.alt" #end >
15  
-    #else
16  
-        <div id="$id">
17  
-    #end
18  
-
19  
-    #if( $banner.src )
20  
-        #set ( $src = $banner.src )
21  
-        #if ( ! ( $src.toLowerCase().startsWith("http") || $src.toLowerCase().startsWith("https") ) )
22  
-            #set ( $src = $PathTool.calculateLink( $src, $relativePath ) )
23  
-            #set ( $src = $src.replaceAll( "\\", "/" ) )
24  
-        #end
25  
-        #if ( $banner.alt )
26  
-            #set ( $alt = $banner.alt )
27  
-        #else
28  
-            #set ( $alt = $banner.name )
29  
-        #end
30  
-        <img src="$src" alt="$alt" />
31  
-    #else
32  
-        $banner.name
33  
-    #end
34  
-
35  
-    #if( $banner.href )
36  
-        </a>
37  
-    #else
38  
-        </div>
39  
-    #end
40  
-  #end
41  
-#end
42  
-
43  
-#macro ( links $links )
44  
-  #set ( $counter = 0 )
45  
-  #foreach( $item in $links )
46  
-    #set ( $counter = $counter + 1 )
47  
-    #set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) )
48  
-    #set ( $currentItemHref = $currentItemHref.replaceAll( "\\", "/" ) )
49  
-    #link( $currentItemHref $item.name )
50  
-    #if ( $links.size() > $counter )
51  
-      |
52  
-    #end
53  
-  #end
54  
-#end
55  
-
56  
-#macro ( breadcrumbs $breadcrumbs )
57  
-  #set ( $counter = 0 )
58  
-  #foreach( $item in $breadcrumbs )
59  
-    #set ( $counter = $counter + 1 )
60  
-    #set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) )
61  
-    #set ( $currentItemHref = $currentItemHref.replaceAll( "\\", "/" ) )
62  
-
63  
-    #if ( $currentItemHref == $alignedFileName || $currentItemHref == "" )
64  
-      $item.name
65  
-    #else
66  
-      #link( $currentItemHref $item.name )
67  
-    #end
68  
-    #if ( $breadcrumbs.size() > $counter )
69  
-      &gt;
70  
-    #end
71  
-  #end
72  
-#end
73  
-
74  
-#macro ( displayTree $display $item )
75  
-  #if ( $item && $item.items && $item.items.size() > 0 )
76  
-    #foreach( $subitem in $item.items )
77  
-      #set ( $subitemHref = $PathTool.calculateLink( $subitem.href, $relativePath ) )
78  
-      #set ( $subitemHref = $subitemHref.replaceAll( "\\", "/" ) )
79  
-      #if ( $alignedFileName == $subitemHref )
80  
-        #set ( $display = true )
81  
-      #end
82  
-
83  
-      #displayTree( $display $subitem )
84  
-    #end
85  
-  #end
86  
-#end
87  
-
88  
-#macro ( menuItem $item )
89  
-  #set ( $collapse = "none" )
90  
-  #set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) )
91  
-  #set ( $currentItemHref = $currentItemHref.replaceAll( "\\", "/" ) )
92  
-
93  
-  #if ( $item && $item.items && $item.items.size() > 0 )
94  
-    #if ( $item.collapse == false )
95  
-      #set ( $collapse = "expanded" )
96  
-    #else
97  
-      ## By default collapsed
98  
-      #set ( $collapse = "collapsed" )
99  
-    #end
100  
-
101  
-    #set ( $display = false )
102  
-    #displayTree( $display $item )
103  
-
104  
-    #if ( $alignedFileName == $currentItemHref || $display )
105  
-      #set ( $collapse = "expanded" )
106  
-    #end
107  
-  #end
108  
-  <li class="$collapse">
109  
-    #if ( $item.img )
110  
-      #if ( ! ( $item.img.toLowerCase().startsWith("http") || $item.img.toLowerCase().startsWith("https") ) )
111  
-        #set ( $src = $PathTool.calculateLink( $item.img, $relativePath ) )
112  
-        #set ( $src = $src.replaceAll( "\\", "/" ) )
113  
-        <img src="$src"/>
114  
-      #else
115  
-        <img src="$item.img" align="absbottom" style="border-width: 0"/>
116  
-      #end
117  
-    #end
118  
-    #if ( $alignedFileName == $currentItemHref )
119  
-      <strong>$item.name</strong>
120  
-    #else
121  
-      #link( $currentItemHref $item.name )
122  
-    #end
123  
-  #if ( $item && $item.items && $item.items.size() > 0 )
124  
-    #if ( $collapse == "expanded" )
125  
-      <ul>
126  
-        #foreach( $subitem in $item.items )
127  
-          #menuItem( $subitem )
128  
-        #end
129  
-      </ul>
130  
-    #end
131  
-  #end
132  
-  </li>
133  
-#end
134  
-
135  
-#macro ( mainMenu $menus )
136  
-  #foreach( $menu in $menus )
137  
-    #if ( $menu.name )
138  
-    <h5>$menu.name</h5>
139  
-    #end
140  
-    #if ( $menu.items && $menu.items.size() > 0 )
141  
-    <ul>
142  
-      #foreach( $item in $menu.items )
143  
-        #menuItem( $item )
144  
-      #end
145  
-    </ul>
146  
-    #end
147  
-  #end
148  
-#end
149  
-
150  
-#macro ( copyright )
151  
-  #if ( $project )
152  
-    #set ( $currentYear = ${currentDate.year} + 1900 )
153  
-
154  
-    #if ( ${project.inceptionYear} && ( ${project.inceptionYear} != ${currentYear.toString()} ) )
155  
-      ${project.inceptionYear}-${currentYear}
156  
-    #else
157  
-      ${currentYear}
158  
-    #end
159  
-
160  
-    #if ( ${project.organization} && ${project.organization.name} )
161  
-      ${project.organization.name}
162  
-    #end
163  
-  #end
164  
-#end
165  
-
166  
-#macro ( publishDate $position $publishDate $version )
167  
-  #if ( $publishDate && $publishDate.format )
168  
-    #set ( $format = $publishDate.format )
169  
-  #else
170  
-    #set ( $format = "yyyy-MM-dd" )
171  
-  #end
172  
-
173  
-  $dateFormat.applyPattern( $format )
174  
-
175  
-  #set ( $dateToday = $dateFormat.format( $currentDate ) )
176  
-
177  
-  #if ( $publishDate && $publishDate.position )
178  
-    #set ( $datePosition = $publishDate.position )
179  
-  #else
180  
-    #set ( $datePosition = "left" )
181  
-  #end
182  
-
183  
-  #if ( $version )
184  
-    #if ( $version.position )
185  
-      #set ( $versionPosition = $version.position )
186  
-    #else
187  
-      #set ( $versionPosition = "left" )
188  
-    #end
189  
-  #else
190  
-    #set ( $version = "" )
191  
-    #set ( $versionPosition = "left" )
192  
-  #end
193  
-
194  
-  #set ( $breadcrumbs = $decoration.body.breadcrumbs )
195  
-  #set ( $links = $decoration.body.links )
196  
-
197  
-  #if ( $datePosition.equalsIgnoreCase( "right" ) && $links && $links.size() > 0 )
198  
-    #set ( $prefix = "&nbsp;|" )
199  
-  #else
200  
-    #set ( $prefix = "" )
201  
-  #end
202  
-
203  
-  #if ( $datePosition.equalsIgnoreCase( $position ) )
204  
-    #if ( ( $datePosition.equalsIgnoreCase( "right" ) ) || ( $datePosition.equalsIgnoreCase( "bottom" ) ) )
205  
-      $prefix <span id="publishDate">$i18n.getString( "site-renderer", $locale, "template.lastpublished" ): $dateToday</span>
206  
-      #if ( $versionPosition.equalsIgnoreCase( $position ) )
207  
-        &nbsp;| <span id="projectVersion">$i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}</span>
208  
-      #end
209  
-    #elseif ( ( $datePosition.equalsIgnoreCase( "navigation-bottom" ) ) || ( $datePosition.equalsIgnoreCase( "navigation-top" ) ) )
210  
-      <div id="lastPublished">
211  
-        <span id="publishDate">$i18n.getString( "site-renderer", $locale, "template.lastpublished" ): $dateToday</span>
212  
-        #if ( $versionPosition.equalsIgnoreCase( $position ) )
213  
-          &nbsp;| <span id="projectVersion">$i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}</span>
214  
-        #end
215  
-      </div>
216  
-    #elseif ( $datePosition.equalsIgnoreCase("left") )
217  
-      <div class="xleft">
218  
-        <span id="publishDate">$i18n.getString( "site-renderer", $locale, "template.lastpublished" ): $dateToday</span>
219  
-        #if ( $versionPosition.equalsIgnoreCase( $position ) )
220  
-          &nbsp;| <span id="projectVersion">$i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}</span>
221  
-        #end
222  
-        #if ( $breadcrumbs && $breadcrumbs.size() > 0 )
223  
-          | #breadcrumbs( $breadcrumbs )
224  
-        #end
225  
-      </div>
226  
-    #end
227  
-  #elseif ( $versionPosition.equalsIgnoreCase( $position ) )
228  
-    #if ( ( $versionPosition.equalsIgnoreCase( "right" ) ) || ( $versionPosition.equalsIgnoreCase( "bottom" ) ) )
229  
-      $prefix <span id="projectVersion">$i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}</span>
230  
-    #elseif ( ( $versionPosition.equalsIgnoreCase( "navigation-bottom" ) ) || ( $versionPosition.equalsIgnoreCase( "navigation-top" ) ) )
231  
-      <div id="lastPublished">
232  
-        <span id="projectVersion">$i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}</span>
233  
-      </div>
234  
-    #elseif ( $versionPosition.equalsIgnoreCase("left") )
235  
-      <div class="xleft">
236  
-        <span id="projectVersion">$i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}</span>
237  
-        #if ( $breadcrumbs && $breadcrumbs.size() > 0 )
238  
-          | #breadcrumbs( $breadcrumbs )
239  
-        #end
240  
-      </div>
241  
-    #end
242  
-  #elseif ( $position.equalsIgnoreCase( "left" ) )
243  
-    #if ( $breadcrumbs && $breadcrumbs.size() > 0 )
244  
-      <div class="xleft">
245  
-        #breadcrumbs( $breadcrumbs )
246  
-      </div>
247  
-    #end
248  
-  #end
249  
-#end
250  
-
251  
-#macro ( poweredByLogo $poweredBy )
252  
-    #if( $poweredBy )
253  
-        #foreach ($item in $poweredBy)
254  
-            #if( $item.href )
255  
-                #set ( $href = $PathTool.calculateLink( $item.href, $relativePath ) )
256  
-                #set ( $href = $href.replaceAll( "\\", "/" ) )
257  
-            #else
258  
-                #set ( $href="http://maven.apache.org/" )
259  
-            #end
260  
-
261  
-            #if( $item.name )
262  
-                #set ( $name = $item.name )
263  
-            #else
264  
-                #set ( $name = $i18n.getString( "site-renderer", $locale, "template.builtby" )  )
265  
-                #set ( $name = "${name} Maven"  )
266  
-            #end
267  
-
268  
-            #if( $item.img )
269  
-                #set ( $img = $item.img )
270  
-            #else
271  
-                #set ( $img = "images/logos/maven-feather.png" )
272  
-            #end
273  
-
274  
-            <a href="$href" title="$name" class="poweredBy">
275  
-              #set ( $img = $PathTool.calculateLink( $img, $relativePath ) )
276  
-              #set ( $img = $img.replaceAll( "\\", "/" ) )
277  
-              <img  class="poweredBy"  
278  
-                    alt="$name" 
279  
-                    src="$img" 
280  
-                    width="90"
281  
-                    height="30"
282  
-              />
283  
-            </a>
284  
-        #end
285  
-        #if( $poweredBy.isEmpty() )
286  
-          <a href="http://maven.apache.org/" title="$i18n.getString( "site-renderer", $locale, "template.builtby" ) Maven" class="poweredBy">
287  
-            <img class="poweredBy" 
288  
-                 alt="$i18n.getString( "site-renderer", $locale, "template.builtby" ) Maven" 
289  
-                 src="$relativePath/images/logos/maven-feather.png" 
290  
-                 width="90"
291  
-                 height="30"
292  
-                 border="1" />
293  
-          </a>
294  
-        #end
295  
-    #else
296  
-        <a href="http://maven.apache.org/" title="$i18n.getString( "site-renderer", $locale, "template.builtby" ) Maven" class="poweredBy">
297  
-          <img class="poweredBy" 
298  
-               alt="$i18n.getString( "site-renderer", $locale, "template.builtby" ) Maven" 
299  
-               src="$relativePath/images/logos/maven-feather.png" 
300  
-               width="90"
301  
-               height="30"
302  
-               border="1"
303  
-               />
304  
-        </a>
305  
-    #end
306  
-#end
307  
-
308  
-<html xmlns="http://www.w3.org/1999/xhtml">
309  
-  <head>
310  
-    <title>$title</title>
311  
-    <style type="text/css" media="all">
312  
-      @import url("$relativePath/css/maven-base.css");
313  
-      @import url("$relativePath/css/maven-theme.css");
314  
-      @import url("$relativePath/css/site.css");
315  
-    </style>
316  
-    <link rel="stylesheet" href="$relativePath/css/print.css" type="text/css" media="print" />
317  
-    #foreach( $author in $authors )
318  
-      <meta name="author" content="$author" />
319  
-    #end
320  
-    <meta http-equiv="Content-Type" content="text/html; charset=${outputEncoding}" />
321  
-    #if ( $decoration.body.head )
322  
-      #foreach( $item in $decoration.body.head.getChildren() )
323  
-        ## Workaround for DOXIA-150 due to a non-desired behaviour in p-u
324  
-        ## @see org.codehaus.plexus.util.xml.Xpp3Dom#toString()
325  
-        ## @see org.codehaus.plexus.util.xml.Xpp3Dom#toUnescapedString()
326  
-        #set ( $documentHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" )
327  
-        #set ( $documentHeader = $documentHeader.replaceAll( "\\", "" ) )
328  
-        #if ( $item.name == "script" )
329  
-          $StringUtils.replace( $item.toUnescapedString(), $documentHeader, "" )
330  
-        #else
331  
-          $StringUtils.replace( $item.toString(), $documentHeader, "" )
332  
-        #end
333  
-      #end
334  
-    #end
335  
-  </head>
336  
-  <body class="composite">
337  
-    <div id="banner">
338  
-      #banner( $decoration.bannerLeft "bannerLeft" )
339  
-      #banner( $decoration.bannerRight "bannerRight" )
340  
-      <div class="clear">
341  
-        <hr/>
342  
-      </div>
343  
-    </div>
344  
-    <div id="breadcrumbs">
345  
-      #publishDate( "left" $decoration.publishDate $decoration.version )
346  
-      <div class="xright">#links( $decoration.body.links )#publishDate( "right" $decoration.publishDate $decoration.version )</div>
347  
-      <div class="clear">
348  
-        <hr/>
349  
-      </div>
350  
-    </div>
351  
-    <div id="leftColumn">
352  
-      <div id="navcolumn">
353  
-       #publishDate( "navigation-top" $decoration.publishDate $decoration.version )
354  
-       #mainMenu( $decoration.body.menus )
355  
-       #poweredByLogo( $decoration.poweredBy )
356  
-       #publishDate( "navigation-bottom" $decoration.publishDate $decoration.version )
357  
-      </div>
358  
-    </div>
359  
-    <div id="bodyColumn">
360  
-      <div id="contentBox">
361  
-        $bodyContent
362  
-      </div>
363  
-    </div>
364  
-    <div class="clear">
365  
-      <hr/>
366  
-    </div>
367  
-    <div id="footer">
368  
-      <div class="xright">&#169;#copyright()#publishDate( "bottom" $decoration.publishDate $decoration.version )</div>
369  
-      <div class="clear">
370  
-        <hr/>
371  
-      </div>
372  
-    </div>
373  
-  </body>
374  
-</html>
9  src/site/site.xml
... ...
@@ -1,14 +1,9 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <project name="JOpt Simple - a Java command line parsing library">
3  
-    <publishDate position="navigation-bottom" format="MMMM dd, yyyy"/>
4  
-    <poweredBy>
5  
-        <logo name="Maven" href="http://maven.apache.org/"
6  
-            img="http://maven.apache.org/images/logos/maven-feather.png"/>
7  
-    </poweredBy>
8  
-    <bannerLeft>
  3
+   <bannerLeft>
9 4
         <name>JOpt Simple</name>
10 5
         <src>images/jopt-simple-logo.png</src>
11  
-        <href>http://jopt-simple.sourceforge.net</href>
  6
+        <href>http://pholser.github.com/jopt-simple/</href>
12 7
     </bannerLeft>
13 8
     <body>
14 9
         <menu name="JOpt Simple">
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.