Author: olamy
Date: Sat Oct 6 15:12:45 2012
New Revision: 1395092
URL: http://svn.apache.org/viewvc?rev=1395092&view=rev
Log:
resize a bit doc h1/h2/h3 are quite big
Modified:
archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/docs.html
Modified:
archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java
URL:
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java?rev=1395092&r1=1395091&r2=1395092&view=diff
==============================================================================
---
archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java
(original)
+++
archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java
Sat Oct 6 15:12:45 2012
@@ -65,9 +65,7 @@ public class RestDocsServlet
for ( Iterator<Element> elementIterator = links.iterator();
elementIterator.hasNext(); )
{
Element link = elementIterator.next();
- //link.attr( "onclick", "loadRestDocs('" + startPath + "\',\'"+
"rest-docs/" + startPath + "/" + link.attr( "href" ) + "\');" );
link.attr( "href", "#" + startPath + "/" + link.attr( "href" ) );
-
}
Elements codes = body.select( "code" );
@@ -78,14 +76,36 @@ public class RestDocsServlet
code.attr( "class", code.attr( "class" ) + " nice-code" );
}
- //res.appendChild( body.child( 1 ) );
+ //default generated enunciate use h1/h2/h3 which is quite big so
transform to h3/h4/h5
+
+ Elements headers = body.select( "h1" );
+
+ for ( Iterator<Element> elementIterator = headers.iterator();
elementIterator.hasNext(); )
+ {
+ Element header = elementIterator.next();
+ header.tagName( "h3" );
+ }
+
+ headers = body.select( "h2" );
+
+ for ( Iterator<Element> elementIterator = headers.iterator();
elementIterator.hasNext(); )
+ {
+ Element header = elementIterator.next();
+ header.tagName( "h4" );
+ }
+
+ headers = body.select( "h3" );
+
+ for ( Iterator<Element> elementIterator = headers.iterator();
elementIterator.hasNext(); )
+ {
+ Element header = elementIterator.next();
+ header.tagName( "h5" );
+ }
Document res = new Document( "" );
res.appendChild( body.select( "div[id=main]" ).first() );
resp.getOutputStream().write( res.outerHtml().getBytes() );
- //IOUtils.copy( is, resp.getOutputStream() );
- //super.doGet( req, resp );
}
}
Modified:
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/docs.html
URL:
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/docs.html?rev=1395092&r1=1395091&r2=1395092&view=diff
==============================================================================
---
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/docs.html
(original)
+++
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/docs.html
Sat Oct 6 15:12:45 2012
@@ -20,7 +20,7 @@
<script id="rest_docs" type="text/html">
<div id="rest-doc-header">
<div class="page-header">
- <div><b>${$.i18n.prop('docs.rest.header')}</b></div>
+ <h3><b>${$.i18n.prop('docs.rest.header')}</b></h3>
</div>
<div id="docs_rest_choice">
<ul>