mirror of https://github.com/apache/archiva.git
resize a bit doc h1/h2/h3 are quite big
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1395092 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e771739ee8
commit
a69ee292be
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue