svn commit: r591655 - in /maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x: doxia-decoration-model/pom.xml doxia-doc-renderer/pom.xml doxia-site-renderer/pom.xml pom.xml
Author: dennisl Date: Sat Nov 3 10:39:00 2007 New Revision: 591655 URL: http://svn.apache.org/viewvc?rev=591655&view=rev Log: [maven-release-plugin] prepare release doxia-sitetools-1.0-alpha-10 Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-decoration-model/pom.xml maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-doc-renderer/pom.xml maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-site-renderer/pom.xml maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/pom.xml Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-decoration-model/pom.xml URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-decoration-model/pom.xml?rev=591655&r1=591654&r2=591655&view=diff == --- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-decoration-model/pom.xml (original) +++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-decoration-model/pom.xml Sat Nov 3 10:39:00 2007 @@ -24,7 +24,7 @@ doxia-sitetools org.apache.maven.doxia -1.0-alpha-10-SNAPSHOT +1.0-alpha-10 doxia-decoration-model Doxia Decoration Model Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-doc-renderer/pom.xml URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-doc-renderer/pom.xml?rev=591655&r1=591654&r2=591655&view=diff == --- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-doc-renderer/pom.xml (original) +++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-doc-renderer/pom.xml Sat Nov 3 10:39:00 2007 @@ -24,7 +24,7 @@ doxia-sitetools org.apache.maven.doxia -1.0-alpha-10-SNAPSHOT +1.0-alpha-10 doxia-doc-renderer Doxia Document Renderer Component Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-site-renderer/pom.xml URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-site-renderer/pom.xml?rev=591655&r1=591654&r2=591655&view=diff == --- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-site-renderer/pom.xml (original) +++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-site-renderer/pom.xml Sat Nov 3 10:39:00 2007 @@ -24,7 +24,7 @@ doxia-sitetools org.apache.maven.doxia -1.0-alpha-10-SNAPSHOT +1.0-alpha-10 doxia-site-renderer Doxia Site Renderer Component Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/pom.xml URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/pom.xml?rev=591655&r1=591654&r2=591655&view=diff == --- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/pom.xml (original) +++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/pom.xml Sat Nov 3 10:39:00 2007 @@ -30,7 +30,7 @@ org.apache.maven.doxia doxia-sitetools - 1.0-alpha-10-SNAPSHOT + 1.0-alpha-10 pom Doxia Sitetools @@ -91,9 +91,9 @@ - scm:svn:https://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/ - scm:svn:https://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/ - https://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/ + scm:svn:https://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.0-alpha-10 + scm:svn:https://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.0-alpha-10 + https://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.0-alpha-10
svn commit: r591656 - in /maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.0-alpha-10: ./ doxia-decoration-model/pom.xml doxia-doc-renderer/pom.xml doxia-site-renderer/pom.xml pom.xml
Author: dennisl Date: Sat Nov 3 10:39:12 2007 New Revision: 591656 URL: http://svn.apache.org/viewvc?rev=591656&view=rev Log: [maven-scm] copy for tag doxia-sitetools-1.0-alpha-10 Added: maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.0-alpha-10/ - copied from r591504, maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/ maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.0-alpha-10/doxia-decoration-model/pom.xml - copied unchanged from r591655, maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-decoration-model/pom.xml maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.0-alpha-10/doxia-doc-renderer/pom.xml - copied unchanged from r591655, maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-doc-renderer/pom.xml maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.0-alpha-10/doxia-site-renderer/pom.xml - copied unchanged from r591655, maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-site-renderer/pom.xml maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.0-alpha-10/pom.xml - copied unchanged from r591655, maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/pom.xml
svn commit: r591657 - in /maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x: doxia-decoration-model/pom.xml doxia-doc-renderer/pom.xml doxia-site-renderer/pom.xml pom.xml
Author: dennisl Date: Sat Nov 3 10:39:24 2007 New Revision: 591657 URL: http://svn.apache.org/viewvc?rev=591657&view=rev Log: [maven-release-plugin] prepare for next development iteration Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-decoration-model/pom.xml maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-doc-renderer/pom.xml maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-site-renderer/pom.xml maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/pom.xml Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-decoration-model/pom.xml URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-decoration-model/pom.xml?rev=591657&r1=591656&r2=591657&view=diff == --- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-decoration-model/pom.xml (original) +++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-decoration-model/pom.xml Sat Nov 3 10:39:24 2007 @@ -24,7 +24,7 @@ doxia-sitetools org.apache.maven.doxia -1.0-alpha-10 +1.0-alpha-11-SNAPSHOT doxia-decoration-model Doxia Decoration Model Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-doc-renderer/pom.xml URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-doc-renderer/pom.xml?rev=591657&r1=591656&r2=591657&view=diff == --- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-doc-renderer/pom.xml (original) +++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-doc-renderer/pom.xml Sat Nov 3 10:39:24 2007 @@ -24,7 +24,7 @@ doxia-sitetools org.apache.maven.doxia -1.0-alpha-10 +1.0-alpha-11-SNAPSHOT doxia-doc-renderer Doxia Document Renderer Component Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-site-renderer/pom.xml URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-site-renderer/pom.xml?rev=591657&r1=591656&r2=591657&view=diff == --- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-site-renderer/pom.xml (original) +++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/doxia-site-renderer/pom.xml Sat Nov 3 10:39:24 2007 @@ -24,7 +24,7 @@ doxia-sitetools org.apache.maven.doxia -1.0-alpha-10 +1.0-alpha-11-SNAPSHOT doxia-site-renderer Doxia Site Renderer Component Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/pom.xml URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/pom.xml?rev=591657&r1=591656&r2=591657&view=diff == --- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/pom.xml (original) +++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/pom.xml Sat Nov 3 10:39:24 2007 @@ -30,7 +30,7 @@ org.apache.maven.doxia doxia-sitetools - 1.0-alpha-10 + 1.0-alpha-11-SNAPSHOT pom Doxia Sitetools @@ -91,9 +91,9 @@ - scm:svn:https://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.0-alpha-10 - scm:svn:https://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.0-alpha-10 - https://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.0-alpha-10 + scm:svn:https://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/ + scm:svn:https://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/ + https://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0-alpha-x/
svn commit: r591684 - in /maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia: parser/XhtmlBaseParser.java sink/XhtmlBaseSink.java
Author: ltheussl Date: Sat Nov 3 13:54:56 2007 New Revision: 591684 URL: http://svn.apache.org/viewvc?rev=591684&view=rev Log: Add some base classes to handle common html events Added: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java (with props) maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java (with props) Added: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java?rev=591684&view=auto == --- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java (added) +++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java Sat Nov 3 13:54:56 2007 @@ -0,0 +1,668 @@ +package org.apache.maven.doxia.parser; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +import javax.swing.text.html.HTML.Attribute; +import javax.swing.text.html.HTML.Tag; + +import org.apache.maven.doxia.macro.MacroExecutionException; +import org.apache.maven.doxia.parser.AbstractXmlParser; +import org.apache.maven.doxia.sink.Sink; + +import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.xml.pull.XmlPullParser; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +/** + * Common base parser for xhtml events. + * + * @author mailto:[EMAIL PROTECTED]">Jason van Zyl + * @author ltheussl + * @version $Id$ + * @since 1.0 + */ +public class XhtmlBaseParser +extends AbstractXmlParser +{ +/** Used to distinguish from . */ +private boolean isLink; + +/** Used to distinguish from . */ +private boolean isAnchor; + +/** Used for nested lists. */ +private int orderedListDepth = 0; + +/** For tables. */ +private boolean hasCaption; + +/** Counts section level. */ +private int sectionLevel; + +/** + * + * Goes through a common list of possible html start tags. These include only tags that can go into + * the body of a xhtml document and so should be re-usable by different xhtml-based parsers. + * + * + * The currently handled tags are: + * + * + * + *,
,
,
,
,
,
, + *,
,
- ,
,
- ,
- , , , + * , ,
, , , ,
,
, + * , , ,
,
,. + * + * + * + * @param parser A parser. + * @param sink the sink to receive the events. + * @return True if the event has been handled by this method, i.e. the tag was recognized, false otherwise. + */ +public boolean baseStartTag( XmlPullParser parser, Sink sink ) +{ +boolean visited = true; + +if ( parser.getName().equals( Tag.H2.toString() ) ) +{ +closeOpenSections( Sink.SECTION_LEVEL_1, sink ); + +sink.section1(); + +sink.sectionTitle1(); +} +else if ( parser.getName().equals( Tag.H3.toString() ) ) +{ +closeOpenSections( Sink.SECTION_LEVEL_2, sink ); + +sink.section2(); + +sink.sectionTitle2(); +} +else if ( parser.getName().equals( Tag.H4.toString() ) ) +{ +closeOpenSections( Sink.SECTION_LEVEL_3, sink ); + +sink.section3(); + +sink.sectionTitle3(); +} +else if ( parser.getName().equals( Tag.H5.toString() ) ) +{ +closeOpenSections( Sink.SECTION_LEVEL_4, sink ); + +sink.section4(); + +sink.sectionTitle4(); +} +else if ( parser.getName().equals( Tag.H6.toString() ) ) +{ +closeOpenSections( Sink.SECTION_LEVEL_5, sink ); + +sink.section5(); + +sink.sectionTitle5(); +} +else if ( parser.getName().equals( Tag.P.toString() ) ) +{ +sink.paragraph()
svn commit: r591685 - /maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
Author: ltheussl Date: Sat Nov 3 13:55:58 2007 New Revision: 591685 URL: http://svn.apache.org/viewvc?rev=591685&view=rev Log: Add a convenience method to parse a string Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java?rev=591685&r1=591684&r2=591685&view=diff == --- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java (original) +++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java Sat Nov 3 13:55:58 2007 @@ -21,6 +21,7 @@ import java.io.IOException; import java.io.Reader; +import java.io.StringReader; import org.apache.maven.doxia.macro.MacroExecutionException; import org.apache.maven.doxia.markup.XmlMarkup; @@ -60,6 +61,20 @@ { throw new ParseException( "Macro execution failed: " + ex.getMessage(), ex ); } +} + +/** + * Convenience method to parse an arbitrary string and emit any xml events into the given sink. + * + * @param string A string that provides the source input. The string has to be completely + * enclosed inside one xml root element, otherwise a ParseException is thrown. + * @param sink A sink that consumes the Doxia events. + * @throws ParseException if the string does not represent a well-formed xml snippet. + */ +public void parse( String string, Sink sink ) +throws ParseException +{ +parse( new StringReader( string ), sink ); } /** [EMAIL PROTECTED] */
svn commit: r591687 [2/2] - in /maven/doxia/doxia/trunk/doxia-modules: doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/ doxia-module-xhtml/src/main/java/org/apache/maven/doxia/modul
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java?rev=591687&r1=591686&r2=591687&view=diff == --- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java (original) +++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java Sat Nov 3 13:59:15 2007 @@ -19,7 +19,6 @@ * under the License. */ -import java.io.PrintWriter; import java.io.Writer; import java.util.Map; @@ -29,54 +28,32 @@ import javax.swing.text.html.HTML.Tag; import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext; -import org.apache.maven.doxia.parser.Parser; -import org.apache.maven.doxia.sink.AbstractXmlSink; -import org.apache.maven.doxia.sink.StructureSink; -import org.apache.maven.doxia.util.HtmlTools; +import org.apache.maven.doxia.sink.XhtmlBaseSink; import org.codehaus.plexus.util.StringUtils; /** * Xhtml sink implementation. * * @author Jason van Zyl + * @author ltheussl * @version $Id$ * @since 1.0 * @plexus.component role="org.apache.maven.doxia.sink.Sink" role-hint="xhtml" */ public class XhtmlSink -extends AbstractXmlSink +extends XhtmlBaseSink implements XhtmlMarkup { // -- // Instance fields // -- -/** The PrintWriter to write the result. */ -private PrintWriter writer; - -/** Used to collect text events. */ -private StringBuffer buffer = new StringBuffer(); - -/** An indication on if we're inside a head. */ -private boolean headFlag; - -/** An indication on if we're in verbatim mode. */ -private boolean verbatimFlag; - // TODO: this doesn't belong here private RenderingContext renderingContext; -/** Justification of table cells. */ -private int[] cellJustif; - -/** Number of cells in a table row. */ -private int cellCount; - -/** Used to style successive table rows differently. */ -private boolean evenTableRow = true; // -- -// +// Constructors // -- /** @@ -93,7 +70,7 @@ */ public XhtmlSink( Writer writer, RenderingContext renderingContext ) { -this.writer = new PrintWriter( writer ); +super( writer ); this.renderingContext = renderingContext; } @@ -109,52 +86,12 @@ this( writer, renderingContext ); } -// -- -// Public protected methods -// -- - -/** - * @return the current buffer - */ -protected StringBuffer getBuffer() -{ -return buffer; -} - -/** - * @param headFlag an header flag - */ -protected void setHeadFlag( boolean headFlag ) -{ -this.headFlag = headFlag; -} - -/** - * Reset all variables. - */ -protected void resetState() -{ -headFlag = false; -resetBuffer(); -verbatimFlag = false; -cellJustif = null; -cellCount = 0; -} - -/** - * Reset the buffer. - */ -protected void resetBuffer() -{ -buffer = new StringBuffer(); -} - /** [EMAIL PROTECTED] */ public void head() { resetState(); -headFlag = true; +setHeadFlag( true ); write( "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\";>" ); write( "http://www.w3.org/1999/xhtml\";>" ); @@ -165,7 +102,7 @@ /** [EMAIL PROTECTED] */ public void head_() { -headFlag = false; +setHeadFlag( false ); writeEndTag( Tag.HEAD ); } @@ -185,7 +122,7 @@ */ public void title_() { -content( buffer.toString() ); +content( getBuffer().toString() ); writeEndTag( Tag.TITLE ); @@ -198,11 +135,11 @@ */ public void author_() { -if ( buffer.length() > 0 ) +if ( getBuffer().length() > 0 ) { MutableAttributeSet att = new SimpleAttributeSet(); att.addAttribute( Attribute.NAME, "author" ); -att.addAttribute( Attribute.CONTENT, buffer.toString() ); +att.addAttribute( Attribute.CONTENT, getBuffer().toString() ); writeSimpleTag( Tag.META, att ); @@ -216,11 +153,11 @@ */ public voi
svn commit: r591688 - in /maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml: FmlContentParser.java FmlMarkup.java FmlParser.java
Author: ltheussl Date: Sat Nov 3 14:01:48 2007 New Revision: 591688 URL: http://svn.apache.org/viewvc?rev=591688&view=rev Log: [DOXIA-148] Remove html specifics, use XhtmlBaseParser. Added: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlContentParser.java (with props) maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlMarkup.java (with props) Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java Added: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlContentParser.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlContentParser.java?rev=591688&view=auto == --- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlContentParser.java (added) +++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlContentParser.java Sat Nov 3 14:01:48 2007 @@ -0,0 +1,67 @@ +package org.apache.maven.doxia.module.fml; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +import org.apache.maven.doxia.macro.MacroExecutionException; +import org.apache.maven.doxia.parser.XhtmlBaseParser; +import org.apache.maven.doxia.sink.Sink; + +import org.codehaus.plexus.util.xml.pull.XmlPullParser; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +/** + * Parse Fml questions and answers, these may contain arbitrary xdoc elements. + * + * @author ltheussl + * @version $Id$ + * @since 1.0 + */ +public class FmlContentParser +extends XhtmlBaseParser +implements FmlMarkup +{ +/** [EMAIL PROTECTED] */ +protected void handleStartTag( XmlPullParser parser, Sink sink ) +throws XmlPullParserException, MacroExecutionException +{ +if ( parser.getName().equals( SOURCE_TAG.toString() ) ) +{ +sink.verbatim( true ); +} +else if ( !baseStartTag( parser, sink ) ) +{ +// TODO: log( "Unrecognized start tag!" ); +} +} + +/** [EMAIL PROTECTED] */ +protected void handleEndTag( XmlPullParser parser, Sink sink ) +throws XmlPullParserException, MacroExecutionException +{ +if ( parser.getName().equals( SOURCE_TAG.toString() ) ) +{ +sink.verbatim_(); +} +else if ( !baseEndTag( parser, sink ) ) +{ +// TODO: log( "Unrecognized end tag!" ); +} +} +} Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlContentParser.java -- svn:eol-style = native Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlContentParser.java -- svn:keywords = "Author Date Id Revision" Added: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlMarkup.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlMarkup.java?rev=591688&view=auto == --- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlMarkup.java (added) +++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlMarkup.java Sat Nov 3 14:01:48 2007 @@ -0,0 +1,102 @@ +package org.apache.maven.doxia.module.fml; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * rega
svn commit: r591689 - /maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java
Author: ltheussl Date: Sat Nov 3 14:04:10 2007 New Revision: 591689 URL: http://svn.apache.org/viewvc?rev=591689&view=rev Log: Test entities in links. New FmlParser converts code into tt. Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java?rev=591689&r1=591688&r2=591689&view=diff == --- maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java (original) +++ maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java Sat Nov 3 14:04:10 2007 @@ -769,7 +769,7 @@ assertEquals( a.asText().trim(), "source document" ); a = (HtmlAnchor) elementIterator.next(); -assertEquals( a.getAttributeValue( "href" ), "http://maven.apache.org/"; ); +assertEquals( a.getAttributeValue( "href" ), "http://maven.apache.org/?l=a&m=b"; ); assertEquals( a.asText().trim(), "external link" ); element = (HtmlElement) elementIterator.next(); @@ -814,7 +814,7 @@ p = (HtmlParagraph) elementIterator.next(); element = (HtmlElement) elementIterator.next(); -assertEquals( element.getTagName(), "code" ); +assertEquals( element.getTagName(), "tt" ); assertEquals( element.asText().trim(), "" ); div = (HtmlDivision) elementIterator.next();
svn commit: r591691 - /maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/site/fml/faq.fml
Author: ltheussl Date: Sat Nov 3 14:05:43 2007 New Revision: 591691 URL: http://svn.apache.org/viewvc?rev=591691&view=rev Log: Update test faq to test entities in links Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/site/fml/faq.fml Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/site/fml/faq.fml URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/site/fml/faq.fml?rev=591691&r1=591690&r2=591691&view=diff == --- maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/site/fml/faq.fml (original) +++ maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/site/fml/faq.fml Sat Nov 3 14:05:43 2007 @@ -30,7 +30,8 @@ A paragraph with a local link, a link to another source document, - an http://maven.apache.org/";>external link and an italic text. + an http://maven.apache.org/?l=a&m=b";>external link + with entities, and an italic text.
svn commit: r591736 - in /maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src: main/java/org/apache/maven/doxia/module/confluence/parser/ test/java/org/apache/maven/doxia/module/confluen
Author: ltheussl Date: Sun Nov 4 00:19:48 2007 New Revision: 591736 URL: http://svn.apache.org/viewvc?rev=591736&view=rev Log: [DOXIA-180] remove leading # from link Submitted by: Dave Syer Added: maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/resources/link.confluence Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java?rev=591736&r1=591735&r2=591736&view=diff == --- maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java (original) +++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java Sun Nov 4 00:19:48 2007 @@ -99,11 +99,19 @@ if ( link.indexOf( "|" ) > 0 ) { String[] pieces = StringUtils.split( text.toString(), "|" ); + blocks.add( new LinkBlock( pieces[1], pieces[0] ) ); } else { -blocks.add( new LinkBlock( link, link ) ); +String value = link; + +if ( link.startsWith( "#" ) ) +{ +value = link.substring( 1 ); +} + +blocks.add( new LinkBlock( link, value ) ); } text = new StringBuffer(); Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java?rev=591736&r1=591735&r2=591736&view=diff == --- maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java (original) +++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java Sun Nov 4 00:19:48 2007 @@ -230,6 +230,23 @@ assertEquals( 3, result.split( "end:paragraph\n" ).length ); } +/** @throws Exception */ +public void testLink() +throws Exception +{ +String result = locateAndParseTestSourceFile( "link" ); + +assertContainsLines( result, "begin:link, name: middle\ntext: middle\nend:link" ); +assertContainsLines( result, "begin:link, name: end\ntext: end\nend:link" ); +assertContainsLines( result, "begin:link, name: link\ntext: alias\nend:link" ); +assertContainsLines( result, "begin:link, name: link#anchor\ntext: link#anchor\nend:link" ); +assertContainsLines( result, "begin:link, name: #simple\ntext: simple\nend:link" ); +// 3 paragraphs in the input... +assertEquals( 4, result.split( "end:paragraph\n" ).length ); +// 5 links in the input... +assertEquals( 6, result.split( "end:link\n" ).length ); +} + private void assertContainsLines( String message, String result, String lines ) { lines = StringUtils.replace( lines, "\n", EOL ); Added: maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/resources/link.confluence URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/resources/link.confluence?rev=591736&view=auto == --- maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/resources/link.confluence (added) +++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/resources/link.confluence Sun Nov 4 00:19:48 2007 @@ -0,0 +1,5 @@ +Line with [middle] link + +Line with link at the [end] + +Line with [link#anchor] and [#simple] anchor and [alias|link] \ No newline at end of file