This is an automated email from the ASF dual-hosted git repository. michaelo pushed a commit to branch DOXIA-619 in repository https://gitbox.apache.org/repos/asf/maven-doxia.git
commit 0478a608aacebbe9b179a10d497c12c96001db35 Author: Michael Osipov <[email protected]> AuthorDate: Fri Jun 25 00:09:21 2021 +0200 [DOXIA-619] Sink.sectionTitle1() creates <h2> instead of <h1> Completely handle section handling which will now consistently apply between h1 and h5 for HTML and for Markdown. The partially unused or incorrectly mapped section h6 has been dropped. This closes #99 --- .../org/apache/maven/doxia/markup/HtmlMarkup.java | 3 -- .../maven/doxia/parser/Xhtml5BaseParser.java | 38 +++++++++++----------- .../apache/maven/doxia/parser/XhtmlBaseParser.java | 34 +++++++++---------- .../maven/doxia/sink/impl/RandomAccessSink.java | 28 ---------------- .../apache/maven/doxia/sink/impl/SinkAdapter.java | 28 ---------------- .../maven/doxia/sink/impl/Xhtml5BaseSink.java | 24 +++++++------- .../maven/doxia/sink/impl/XhtmlBaseSink.java | 24 +++++++------- .../org/apache/maven/doxia/util/HtmlTools.java | 2 +- .../apache/maven/doxia/macro/toc/TocMacroTest.java | 14 ++++---- .../maven/doxia/parser/Xhtml5BaseParserTest.java | 8 ++--- .../maven/doxia/parser/XhtmlBaseParserTest.java | 8 ++--- .../doxia/sink/impl/SinkEventTestingSink.java | 24 -------------- .../org/apache/maven/doxia/sink/impl/TextSink.java | 24 -------------- .../sink/impl/WellformednessCheckingSink.java | 24 -------------- .../maven/doxia/sink/impl/Xhtml5BaseSinkTest.java | 14 ++++---- .../maven/doxia/sink/impl/XhtmlBaseSinkTest.java | 14 ++++---- .../src/main/resources/fml-1.0.1.xsd | 18 ++-------- .../doxia/module/markdown/MarkdownParserTest.java | 38 +++++++++++----------- .../src/test/resources/comment-before-heading.md | 3 +- .../src/test/resources/first-heading.md | 4 +-- .../src/test/resources/macro-toc-DOXIA-559.md | 2 +- .../src/test/resources/macro-toc.md | 4 +-- .../apache/maven/doxia/module/xdoc/XdocParser.java | 6 ++-- .../apache/maven/doxia/module/xdoc/XdocSink.java | 16 ++++----- .../src/main/resources/xdoc-2.0.xsd | 18 ++-------- .../maven/doxia/module/xdoc/XdocParserTest.java | 28 ++++++++-------- .../maven/doxia/module/xdoc/XdocSinkTest.java | 6 ++-- .../doxia-module-xdoc/src/test/resources/test.xml | 6 ++-- .../maven/doxia/module/xhtml/XhtmlSinkTest.java | 12 +++---- .../doxia-module-xhtml/src/test/resources/fun.html | 2 +- .../src/test/resources/index.xml.vm | 22 ++++++------- .../src/test/resources/test.xhtml | 10 +++--- .../maven/doxia/module/xhtml5/Xhtml5Sink.java | 24 +++++++------- .../maven/doxia/module/xhtml5/Xhtml5SinkTest.java | 12 +++---- .../src/test/resources/fun.html | 2 +- .../src/test/resources/index.xml.vm | 16 ++++----- .../src/test/resources/test.xhtml | 10 +++--- .../java/org/apache/maven/doxia/sink/Sink.java | 38 ---------------------- .../doxia-site/xdoc/references/xdoc-format.xml | 12 +++---- .../xdoc/developers/mojo-api-specification.xml | 6 ++-- 40 files changed, 217 insertions(+), 409 deletions(-) diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/markup/HtmlMarkup.java b/doxia-core/src/main/java/org/apache/maven/doxia/markup/HtmlMarkup.java index 502eee09..7c499a67 100644 --- a/doxia-core/src/main/java/org/apache/maven/doxia/markup/HtmlMarkup.java +++ b/doxia-core/src/main/java/org/apache/maven/doxia/markup/HtmlMarkup.java @@ -402,9 +402,6 @@ public interface HtmlMarkup /** Xhtml tag for <code>h5</code>. */ Tag H5 = Tag.H5; - /** Xhtml tag for <code>h6</code>. */ - Tag H6 = Tag.H6; - /** Xhtml tag for <code>head</code>. */ Tag HEAD = Tag.HEAD; diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/parser/Xhtml5BaseParser.java b/doxia-core/src/main/java/org/apache/maven/doxia/parser/Xhtml5BaseParser.java index cc8f5792..6672f280 100644 --- a/doxia-core/src/main/java/org/apache/maven/doxia/parser/Xhtml5BaseParser.java +++ b/doxia-core/src/main/java/org/apache/maven/doxia/parser/Xhtml5BaseParser.java @@ -117,8 +117,8 @@ public class Xhtml5BaseParser * </p> * <p> * <code> - * <article>, <nav>, <aside>, <section>, <h2>, <h3>, <h4>, - * <h5>, <h6>, <header>, <main>, <footer>, <em>, <strong>, + * <article>, <nav>, <aside>, <section>, <h1>, <h2>, <h3>, + * <h4>, <h5>, <header>, <main>, <footer>, <em>, <strong>, * <small>, <s>, <cite>, <q>, <dfn>, <abbr>, <i>, * <b>, <code>, <samp>, <kbd>, <sub>, <sup>, <u>, * <mark>, <ruby>, <rb>, <rt>, <rtc>, <rp>, <bdi>, @@ -155,23 +155,23 @@ public class Xhtml5BaseParser { handleSectionStart( sink, attribs ); } - else if ( parser.getName().equals( HtmlMarkup.H2.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H1.toString() ) ) { handleHeadingStart( sink, Sink.SECTION_LEVEL_1, attribs ); } - else if ( parser.getName().equals( HtmlMarkup.H3.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H2.toString() ) ) { handleHeadingStart( sink, Sink.SECTION_LEVEL_2, attribs ); } - else if ( parser.getName().equals( HtmlMarkup.H4.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H3.toString() ) ) { handleHeadingStart( sink, Sink.SECTION_LEVEL_3, attribs ); } - else if ( parser.getName().equals( HtmlMarkup.H5.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H4.toString() ) ) { handleHeadingStart( sink, Sink.SECTION_LEVEL_4, attribs ); } - else if ( parser.getName().equals( HtmlMarkup.H6.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H5.toString() ) ) { handleHeadingStart( sink, Sink.SECTION_LEVEL_5, attribs ); } @@ -667,23 +667,23 @@ public class Xhtml5BaseParser { handleSectionEnd( sink ); } - else if ( parser.getName().equals( HtmlMarkup.H2.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H1.toString() ) ) { sink.sectionTitle1_(); } - else if ( parser.getName().equals( HtmlMarkup.H3.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H2.toString() ) ) { sink.sectionTitle2_(); } - else if ( parser.getName().equals( HtmlMarkup.H4.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H3.toString() ) ) { sink.sectionTitle3_(); } - else if ( parser.getName().equals( HtmlMarkup.H5.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H4.toString() ) ) { sink.sectionTitle4_(); } - else if ( parser.getName().equals( HtmlMarkup.H6.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H5.toString() ) ) { sink.sectionTitle5_(); } @@ -805,7 +805,7 @@ public class Xhtml5BaseParser * Make sure sections are nested consecutively. * * <p> - * HTML5 heading tags H1 to H6 imply sections where they are not + * HTML5 heading tags H1 to H5 imply sections where they are not * present, that means we have to open close any sections that * are missing in between. * </p> @@ -814,19 +814,19 @@ public class Xhtml5BaseParser * For instance, if the following sequence is parsed: * </p> * <pre> - * <h3></h3> - * <h6></h6> + * <h2></h2> + * <h5></h5> * </pre> * <p> - * we have to insert two section starts before we open the <code><h6></code>. + * we have to insert two section starts before we open the <code><h5></code>. * In the following sequence * </p> * <pre> - * <h6></h6> - * <h3></h3> + * <h5></h5> + * <h2></h2> * </pre> * <p> - * we have to close two sections before we open the <code><h3></code>. + * we have to close two sections before we open the <code><h2></code>. * </p> * * <p>The current level is set to newLevel afterwards.</p> diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java b/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java index 1aa9bc25..c4f78ff4 100644 --- a/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java +++ b/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java @@ -383,7 +383,7 @@ public class XhtmlBaseParser * </p> * <p> * <code> - * <h2>, <h3>, <h4>, <h5>, <h6>, <p>, <pre>, + * <h1>, <h2>, <h3>, <h4>, <h5>, <p>, <pre>, * <ul>, <ol>, <li>, <dl>, <dt>, <dd>, <b>, <strong>, * <i>, <em>, <code>, <samp>, <tt>, <a>, <table>, <tr>, * <th>, <td>, <caption>, <br/>, <hr/>, <img/>. @@ -400,23 +400,23 @@ public class XhtmlBaseParser SinkEventAttributeSet attribs = getAttributesFromParser( parser ); - if ( parser.getName().equals( HtmlMarkup.H2.toString() ) ) + if ( parser.getName().equals( HtmlMarkup.H1.toString() ) ) { handleSectionStart( sink, Sink.SECTION_LEVEL_1, attribs ); } - else if ( parser.getName().equals( HtmlMarkup.H3.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H2.toString() ) ) { handleSectionStart( sink, Sink.SECTION_LEVEL_2, attribs ); } - else if ( parser.getName().equals( HtmlMarkup.H4.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H3.toString() ) ) { handleSectionStart( sink, Sink.SECTION_LEVEL_3, attribs ); } - else if ( parser.getName().equals( HtmlMarkup.H5.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H4.toString() ) ) { handleSectionStart( sink, Sink.SECTION_LEVEL_4, attribs ); } - else if ( parser.getName().equals( HtmlMarkup.H6.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H5.toString() ) ) { handleSectionStart( sink, Sink.SECTION_LEVEL_5, attribs ); } @@ -688,23 +688,23 @@ public class XhtmlBaseParser { sink.tableCaption_(); } - else if ( parser.getName().equals( HtmlMarkup.H2.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H1.toString() ) ) { sink.sectionTitle1_(); } - else if ( parser.getName().equals( HtmlMarkup.H3.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H2.toString() ) ) { sink.sectionTitle2_(); } - else if ( parser.getName().equals( HtmlMarkup.H4.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H3.toString() ) ) { sink.sectionTitle3_(); } - else if ( parser.getName().equals( HtmlMarkup.H5.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H4.toString() ) ) { sink.sectionTitle4_(); } - else if ( parser.getName().equals( HtmlMarkup.H6.toString() ) ) + else if ( parser.getName().equals( HtmlMarkup.H5.toString() ) ) { sink.sectionTitle5_(); } @@ -822,19 +822,19 @@ public class XhtmlBaseParser * For instance, if the following sequence is parsed: * </p> * <pre> - * <h3></h3> - * <h6></h6> + * <h2></h2> + * <h5></h5> * </pre> * <p> - * we have to insert two section starts before we open the <code><h6></code>. + * we have to insert two section starts before we open the <code><h5></code>. * In the following sequence * </p> * <pre> - * <h6></h6> - * <h3></h3> + * <h5></h5> + * <h2></h2> * </pre> * <p> - * we have to close two sections before we open the <code><h3></code>. + * we have to close two sections before we open the <code><h2></code>. * </p> * * <p>The current level is set to newLevel afterwards.</p> diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/RandomAccessSink.java b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/RandomAccessSink.java index 3cbd943e..87950fd2 100644 --- a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/RandomAccessSink.java +++ b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/RandomAccessSink.java @@ -972,20 +972,6 @@ public class RandomAccessSink currentSink.section5_(); } - /** {@inheritDoc} */ - @Override - public void section6() - { - currentSink.section5(); - } - - /** {@inheritDoc} */ - @Override - public void section6_() - { - currentSink.section5_(); - } - /** {@inheritDoc} */ @Override public void sectionTitle() @@ -1070,20 +1056,6 @@ public class RandomAccessSink currentSink.sectionTitle5_(); } - /** {@inheritDoc} */ - @Override - public void sectionTitle6() - { - currentSink.sectionTitle5(); - } - - /** {@inheritDoc} */ - @Override - public void sectionTitle6_() - { - currentSink.sectionTitle5_(); - } - /** {@inheritDoc} */ @Override public void sectionTitle_() diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/SinkAdapter.java b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/SinkAdapter.java index 692970f7..307735b7 100644 --- a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/SinkAdapter.java +++ b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/SinkAdapter.java @@ -171,20 +171,6 @@ public class SinkAdapter // nop } - /** {@inheritDoc} */ - @Override - public void section6() - { - // nop - } - - /** {@inheritDoc} */ - @Override - public void section6_() - { - // nop - } - /** {@inheritDoc} */ @Override public void list() @@ -465,20 +451,6 @@ public class SinkAdapter // nop } - /** {@inheritDoc} */ - @Override - public void sectionTitle6() - { - // nop - } - - /** {@inheritDoc} */ - @Override - public void sectionTitle6_() - { - // nop - } - /** {@inheritDoc} */ @Override public void header() diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSink.java b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSink.java index b4bdee01..91b40bb9 100644 --- a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSink.java +++ b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSink.java @@ -556,11 +556,11 @@ public class Xhtml5BaseSink * * @param depth The level of the section title. * @param attributes some attributes. May be null. + * @see javax.swing.text.html.HTML.Tag#H1 * @see javax.swing.text.html.HTML.Tag#H2 * @see javax.swing.text.html.HTML.Tag#H3 * @see javax.swing.text.html.HTML.Tag#H4 * @see javax.swing.text.html.HTML.Tag#H5 - * @see javax.swing.text.html.HTML.Tag#H6 */ protected void onSectionTitle( int depth, SinkEventAttributes attributes ) { @@ -569,23 +569,23 @@ public class Xhtml5BaseSink if ( depth == SECTION_LEVEL_1 ) { - writeStartTag( HtmlMarkup.H2, atts ); + writeStartTag( HtmlMarkup.H1, atts ); } else if ( depth == SECTION_LEVEL_2 ) { - writeStartTag( HtmlMarkup.H3, atts ); + writeStartTag( HtmlMarkup.H2, atts ); } else if ( depth == SECTION_LEVEL_3 ) { - writeStartTag( HtmlMarkup.H4, atts ); + writeStartTag( HtmlMarkup.H3, atts ); } else if ( depth == SECTION_LEVEL_4 ) { - writeStartTag( HtmlMarkup.H5, atts ); + writeStartTag( HtmlMarkup.H4, atts ); } else if ( depth == SECTION_LEVEL_5 ) { - writeStartTag( HtmlMarkup.H6, atts ); + writeStartTag( HtmlMarkup.H5, atts ); } } @@ -593,33 +593,33 @@ public class Xhtml5BaseSink * Ends a section title. * * @param depth The level of the section title. + * @see javax.swing.text.html.HTML.Tag#H1 * @see javax.swing.text.html.HTML.Tag#H2 * @see javax.swing.text.html.HTML.Tag#H3 * @see javax.swing.text.html.HTML.Tag#H4 * @see javax.swing.text.html.HTML.Tag#H5 - * @see javax.swing.text.html.HTML.Tag#H6 */ protected void onSectionTitle_( int depth ) { if ( depth == SECTION_LEVEL_1 ) { - writeEndTag( HtmlMarkup.H2 ); + writeEndTag( HtmlMarkup.H1 ); } else if ( depth == SECTION_LEVEL_2 ) { - writeEndTag( HtmlMarkup.H3 ); + writeEndTag( HtmlMarkup.H2 ); } else if ( depth == SECTION_LEVEL_3 ) { - writeEndTag( HtmlMarkup.H4 ); + writeEndTag( HtmlMarkup.H3 ); } else if ( depth == SECTION_LEVEL_4 ) { - writeEndTag( HtmlMarkup.H5 ); + writeEndTag( HtmlMarkup.H4 ); } else if ( depth == SECTION_LEVEL_5 ) { - writeEndTag( HtmlMarkup.H6 ); + writeEndTag( HtmlMarkup.H5 ); } } diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSink.java b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSink.java index e4318f7d..bc7ca83f 100644 --- a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSink.java +++ b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSink.java @@ -502,11 +502,11 @@ public class XhtmlBaseSink * * @param depth The level of the section title. * @param attributes some attributes. May be null. + * @see javax.swing.text.html.HTML.Tag#H1 * @see javax.swing.text.html.HTML.Tag#H2 * @see javax.swing.text.html.HTML.Tag#H3 * @see javax.swing.text.html.HTML.Tag#H4 * @see javax.swing.text.html.HTML.Tag#H5 - * @see javax.swing.text.html.HTML.Tag#H6 */ protected void onSectionTitle( int depth, SinkEventAttributes attributes ) { @@ -515,23 +515,23 @@ public class XhtmlBaseSink if ( depth == SECTION_LEVEL_1 ) { - writeStartTag( HtmlMarkup.H2, atts ); + writeStartTag( HtmlMarkup.H1, atts ); } else if ( depth == SECTION_LEVEL_2 ) { - writeStartTag( HtmlMarkup.H3, atts ); + writeStartTag( HtmlMarkup.H2, atts ); } else if ( depth == SECTION_LEVEL_3 ) { - writeStartTag( HtmlMarkup.H4, atts ); + writeStartTag( HtmlMarkup.H3, atts ); } else if ( depth == SECTION_LEVEL_4 ) { - writeStartTag( HtmlMarkup.H5, atts ); + writeStartTag( HtmlMarkup.H4, atts ); } else if ( depth == SECTION_LEVEL_5 ) { - writeStartTag( HtmlMarkup.H6, atts ); + writeStartTag( HtmlMarkup.H5, atts ); } } @@ -539,33 +539,33 @@ public class XhtmlBaseSink * Ends a section title. * * @param depth The level of the section title. + * @see javax.swing.text.html.HTML.Tag#H1 * @see javax.swing.text.html.HTML.Tag#H2 * @see javax.swing.text.html.HTML.Tag#H3 * @see javax.swing.text.html.HTML.Tag#H4 * @see javax.swing.text.html.HTML.Tag#H5 - * @see javax.swing.text.html.HTML.Tag#H6 */ protected void onSectionTitle_( int depth ) { if ( depth == SECTION_LEVEL_1 ) { - writeEndTag( HtmlMarkup.H2 ); + writeEndTag( HtmlMarkup.H1 ); } else if ( depth == SECTION_LEVEL_2 ) { - writeEndTag( HtmlMarkup.H3 ); + writeEndTag( HtmlMarkup.H2 ); } else if ( depth == SECTION_LEVEL_3 ) { - writeEndTag( HtmlMarkup.H4 ); + writeEndTag( HtmlMarkup.H3 ); } else if ( depth == SECTION_LEVEL_4 ) { - writeEndTag( HtmlMarkup.H5 ); + writeEndTag( HtmlMarkup.H4 ); } else if ( depth == SECTION_LEVEL_5 ) { - writeEndTag( HtmlMarkup.H6 ); + writeEndTag( HtmlMarkup.H5 ); } } diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java b/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java index 4a10ace9..14cfe75e 100644 --- a/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java +++ b/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java @@ -48,7 +48,7 @@ public class HtmlTools HtmlMarkup.DD, HtmlMarkup.DEL, HtmlMarkup.DFN, HtmlMarkup.DIR, HtmlMarkup.DIV, HtmlMarkup.DL, HtmlMarkup.DT, HtmlMarkup.EM, HtmlMarkup.FIELDSET, HtmlMarkup.FONT, HtmlMarkup.FORM, HtmlMarkup.FRAME, HtmlMarkup.FRAMESET, HtmlMarkup.H1, HtmlMarkup.H2, HtmlMarkup.H3, HtmlMarkup.H4, - HtmlMarkup.H5, HtmlMarkup.H6, HtmlMarkup.HEAD, HtmlMarkup.HR, HtmlMarkup.HTML, HtmlMarkup.I, + HtmlMarkup.H5, HtmlMarkup.HEAD, HtmlMarkup.HR, HtmlMarkup.HTML, HtmlMarkup.I, HtmlMarkup.IFRAME, HtmlMarkup.IMG, HtmlMarkup.INPUT, HtmlMarkup.INS, HtmlMarkup.ISINDEX, HtmlMarkup.KBD, HtmlMarkup.KEYGEN, HtmlMarkup.LABEL, HtmlMarkup.LEGEND, HtmlMarkup.LI, HtmlMarkup.LINK, HtmlMarkup.MAP, HtmlMarkup.MENU, HtmlMarkup.META, HtmlMarkup.NOFRAMES, diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/macro/toc/TocMacroTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/macro/toc/TocMacroTest.java index 51accbed..5fd41a4c 100644 --- a/doxia-core/src/test/java/org/apache/maven/doxia/macro/toc/TocMacroTest.java +++ b/doxia-core/src/test/java/org/apache/maven/doxia/macro/toc/TocMacroTest.java @@ -53,7 +53,7 @@ public class TocMacroTest public void testExecute() throws MacroExecutionException { - String sourceContent = "<div><h2>h21</h2><h2>h22</h2><h3>h3</h3><h4>h4</h4><h2>h23</h2></div>"; + String sourceContent = "<div><h1>h11</h1><h1>h12</h1><h2>h2</h2><h3>h3</h3><h1>h13</h1></div>"; XhtmlBaseParser parser = new XhtmlBaseParser(); @@ -124,14 +124,14 @@ public class TocMacroTest assertEquals( "link", ( it.next() ).getName() ); event = it.next(); assertEquals( "text", event.getName() ); - assertEquals( "h22", event.getArgs()[0] ); + assertEquals( "h12", event.getArgs()[0] ); assertEquals( "link_", ( it.next() ).getName() ); assertEquals( "list", ( it.next() ).getName() ); assertEquals( "listItem", ( it.next() ).getName() ); assertEquals( "link", ( it.next() ).getName() ); event = it.next(); assertEquals( "text", event.getName() ); - assertEquals( "h3", event.getArgs()[0] ); + assertEquals( "h2", event.getArgs()[0] ); assertEquals( "link_", ( it.next() ).getName() ); assertEquals( "listItem_", ( it.next() ).getName() ); assertEquals( "list_", ( it.next() ).getName() ); @@ -150,7 +150,7 @@ public class TocMacroTest throws MacroExecutionException { String sourceContent = - "<div><h2>h<b>21</b></h2><h2>h<i>22</i></h2><h3>h<tt>3</tt></h3><h4>h4</h4><h2>h23</h2></div>"; + "<div><h1>h<b>11</b></h1><h1>h<i>12</i></h1><h2>h<tt>2</tt></h2><h3>h3</h3><h1>h13</h1></div>"; XhtmlBaseParser parser = new XhtmlBaseParser(); @@ -165,8 +165,8 @@ public class TocMacroTest TocMacro macro = new TocMacro(); macro.execute( sink, request ); - assertTrue( out.toString().contains( "<a href=\"#h21\">h21</a>" ) ); - assertTrue( out.toString().contains( "<a href=\"#h22\">h22</a>" ) ); - assertTrue( out.toString().contains( "<a href=\"#h3\">h3</a>" ) ); + assertTrue( out.toString().contains( "<a href=\"#h11\">h11</a>" ) ); + assertTrue( out.toString().contains( "<a href=\"#h12\">h12</a>" ) ); + assertTrue( out.toString().contains( "<a href=\"#h2\">h2</a>" ) ); } } diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java index 7f54ce86..e6669aeb 100644 --- a/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java +++ b/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java @@ -71,7 +71,7 @@ public class Xhtml5BaseParserTest public void testHeadingEventsList() throws Exception { - String text = "<p><h2></h2><h3></h3><h4></h4><h5></h5><h6></h6><h2></h2></p>"; + String text = "<p><h1></h1><h2></h2><h3></h3><h4></h4><h5></h5><h1></h1></p>"; parser.parse( text, sink ); @@ -113,7 +113,7 @@ public class Xhtml5BaseParserTest throws Exception { // DOXIA-241 - String text = "<p><h2></h2><h6></h6><h3></h3></p>"; + String text = "<p><h1></h1><h5></h5><h2></h2></p>"; parser.parse( text, sink ); @@ -371,7 +371,7 @@ public class Xhtml5BaseParserTest throws Exception { final String text = "<!DOCTYPE test [<!ENTITY flo \"ř\"><!ENTITY tritPos \"𝟭\"><!ENTITY fo \"A\"><!ENTITY myCustom \"&fo;\">]>" - + "<body><h2>&&flo;ř&tritPos;𝟭</h2><p>&&flo;ř&tritPos;𝟭&myCustom;</p></body>"; + + "<body><h1>&&flo;ř&tritPos;𝟭</h1><p>&&flo;ř&tritPos;𝟭&myCustom;</p></body>"; parser.setValidate( false ); parser.parse( text, sink ); @@ -439,7 +439,7 @@ public class Xhtml5BaseParserTest public void testXhtmlEntities() throws Exception { - final String text = "<body><h2>"&</h2><p>'<></p></body>"; + final String text = "<body><h1>"&</h1><p>'<></p></body>"; parser.parse( text, sink ); diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java index 34eb8e80..b25a28d8 100644 --- a/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java +++ b/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java @@ -75,7 +75,7 @@ public class XhtmlBaseParserTest public void testHeadingEventsList() throws Exception { - String text = "<p><h2></h2><h3></h3><h4></h4><h5></h5><h6></h6><h2></h2></p>"; + String text = "<p><h1></h1><h2></h2><h3></h3><h4></h4><h5></h5><h1></h1></p>"; parser.parse( text, sink ); @@ -118,7 +118,7 @@ public class XhtmlBaseParserTest throws Exception { // DOXIA-241 - String text = "<p><h2></h2><h6></h6><h3></h3></p>"; + String text = "<p><h1></h1><h5></h5><h2></h2></p>"; parser.parse( text, sink ); @@ -383,7 +383,7 @@ public class XhtmlBaseParserTest throws Exception { final String text = "<!DOCTYPE test [<!ENTITY flo \"ř\"><!ENTITY tritPos \"𝟭\"><!ENTITY fo \"A\"><!ENTITY myCustom \"&fo;\">]>" - + "<body><h2>&&flo;ř&tritPos;𝟭</h2><p>&&flo;ř&tritPos;𝟭&myCustom;</p></body>"; + + "<body><h1>&&flo;ř&tritPos;𝟭</h1><p>&&flo;ř&tritPos;𝟭&myCustom;</p></body>"; parser.setValidate( false ); parser.parse( text, sink ); @@ -450,7 +450,7 @@ public class XhtmlBaseParserTest public void testXhtmlEntities() throws Exception { - final String text = "<body><h2>«®</h2><p>“’Φ←</p></body>"; + final String text = "<body><h1>«®</h1><p>“’Φ←</p></body>"; parser.parse( text, sink ); diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkEventTestingSink.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkEventTestingSink.java index 726e98de..5b302b8f 100644 --- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkEventTestingSink.java +++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkEventTestingSink.java @@ -178,18 +178,6 @@ public class SinkEventTestingSink addEvent( "section5_" ); } - @Override - public void section6() - { - addEvent( "section6" ); - } - - @Override - public void section6_() - { - addEvent( "section6_" ); - } - @Override public void list() { @@ -430,18 +418,6 @@ public class SinkEventTestingSink addEvent( "sectionTitle5_" ); } - @Override - public void sectionTitle6() - { - addEvent( "sectionTitle6" ); - } - - @Override - public void sectionTitle6_() - { - addEvent( "sectionTitle6_" ); - } - @Override public void header() { diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/TextSink.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/TextSink.java index 97585a54..b5a34f76 100644 --- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/TextSink.java +++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/TextSink.java @@ -169,18 +169,6 @@ public class TextSink writeln( "end:section5" ); } - @Override - public void section6() - { - write( "begin:section6" ); - } - - @Override - public void section6_() - { - writeln( "end:section6" ); - } - @Override public void list() { @@ -421,18 +409,6 @@ public class TextSink writeln( "end:sectionTitle5" ); } - @Override - public void sectionTitle6() - { - write( "begin:sectionTitle6" ); - } - - @Override - public void sectionTitle6_() - { - writeln( "end:sectionTitle6" ); - } - @Override public void header() { diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/WellformednessCheckingSink.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/WellformednessCheckingSink.java index 1f2bba17..301b2968 100644 --- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/WellformednessCheckingSink.java +++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/WellformednessCheckingSink.java @@ -160,18 +160,6 @@ public class WellformednessCheckingSink checkWellformedness( "section5" ); } - @Override - public void section6() - { - startElement( "section6" ); - } - - @Override - public void section6_() - { - checkWellformedness( "section6" ); - } - @Override public void header() { @@ -449,18 +437,6 @@ public class WellformednessCheckingSink } - @Override - public void sectionTitle6() - { - startElement( "sectionTitle6" ); - } - - @Override - public void sectionTitle6_() - { - checkWellformedness( "sectionTitle6" ); - } - @Override public void paragraph() { diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSinkTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSinkTest.java index d854e82f..cf8f52c5 100644 --- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSinkTest.java +++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSinkTest.java @@ -315,7 +315,7 @@ public class Xhtml5BaseSinkTest sink.close(); } - assertEquals( "<section style=\"bold\">" + LS + "<h2 style=\"bold\"></h2></section>", + assertEquals( "<section style=\"bold\">" + LS + "<h1 style=\"bold\"></h1></section>", writer.toString() ); } @@ -343,7 +343,7 @@ public class Xhtml5BaseSinkTest sink.close(); } - assertEquals( "<section class=\"foo\" id=\"bar\">" + LS + "<h2></h2></section>", writer.toString() ); + assertEquals( "<section class=\"foo\" id=\"bar\">" + LS + "<h1></h1></section>", writer.toString() ); } /** @@ -367,7 +367,7 @@ public class Xhtml5BaseSinkTest sink.close(); } - assertEquals( "<section>" + LS + "<h2></h2></section>", writer.toString() ); + assertEquals( "<section>" + LS + "<h1></h1></section>", writer.toString() ); } /** @@ -391,7 +391,7 @@ public class Xhtml5BaseSinkTest sink.close(); } - assertEquals( "<section>" + LS + "<h3></h3></section>", writer.toString() ); + assertEquals( "<section>" + LS + "<h2></h2></section>", writer.toString() ); } /** @@ -415,7 +415,7 @@ public class Xhtml5BaseSinkTest sink.close(); } - assertEquals( "<section>" + LS + "<h4></h4></section>", writer.toString() ); + assertEquals( "<section>" + LS + "<h3></h3></section>", writer.toString() ); } /** @@ -438,7 +438,7 @@ public class Xhtml5BaseSinkTest sink.close(); } - assertEquals( "<section>" + LS + "<h5></h5></section>", writer.toString() ); + assertEquals( "<section>" + LS + "<h4></h4></section>", writer.toString() ); } /** @@ -461,7 +461,7 @@ public class Xhtml5BaseSinkTest sink.close(); } - assertEquals( "<section>" + LS + "<h6></h6></section>", writer.toString() ); + assertEquals( "<section>" + LS + "<h5></h5></section>", writer.toString() ); } /** diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSinkTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSinkTest.java index e02da966..bea64e93 100644 --- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSinkTest.java +++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSinkTest.java @@ -206,7 +206,7 @@ public class XhtmlBaseSinkTest sink.close(); } - assertEquals( "<div class=\"section\" style=\"bold\">" + LS + "<h2 style=\"bold\"></h2></div>", + assertEquals( "<div class=\"section\" style=\"bold\">" + LS + "<h1 style=\"bold\"></h1></div>", writer.toString() ); } @@ -234,7 +234,7 @@ public class XhtmlBaseSinkTest sink.close(); } - assertEquals( "<div class=\"foo\" id=\"bar\">" + LS + "<h2></h2></div>", writer.toString() ); + assertEquals( "<div class=\"foo\" id=\"bar\">" + LS + "<h1></h1></div>", writer.toString() ); } /** @@ -258,7 +258,7 @@ public class XhtmlBaseSinkTest sink.close(); } - assertEquals( "<div class=\"section\">" + LS + "<h2></h2></div>", writer.toString() ); + assertEquals( "<div class=\"section\">" + LS + "<h1></h1></div>", writer.toString() ); } /** @@ -282,7 +282,7 @@ public class XhtmlBaseSinkTest sink.close(); } - assertEquals( "<div class=\"section\">" + LS + "<h3></h3></div>", writer.toString() ); + assertEquals( "<div class=\"section\">" + LS + "<h2></h2></div>", writer.toString() ); } /** @@ -306,7 +306,7 @@ public class XhtmlBaseSinkTest sink.close(); } - assertEquals( "<div class=\"section\">" + LS + "<h4></h4></div>", writer.toString() ); + assertEquals( "<div class=\"section\">" + LS + "<h3></h3></div>", writer.toString() ); } /** @@ -329,7 +329,7 @@ public class XhtmlBaseSinkTest sink.close(); } - assertEquals( "<div class=\"section\">" + LS + "<h5></h5></div>", writer.toString() ); + assertEquals( "<div class=\"section\">" + LS + "<h4></h4></div>", writer.toString() ); } /** @@ -352,7 +352,7 @@ public class XhtmlBaseSinkTest sink.close(); } - assertEquals( "<div class=\"section\">" + LS + "<h6></h6></div>", writer.toString() ); + assertEquals( "<div class=\"section\">" + LS + "<h5></h5></div>", writer.toString() ); } /** diff --git a/doxia-modules/doxia-module-fml/src/main/resources/fml-1.0.1.xsd b/doxia-modules/doxia-module-fml/src/main/resources/fml-1.0.1.xsd index 2ae80090..524b248c 100644 --- a/doxia-modules/doxia-module-fml/src/main/resources/fml-1.0.1.xsd +++ b/doxia-modules/doxia-module-fml/src/main/resources/fml-1.0.1.xsd @@ -419,7 +419,7 @@ <xs:attributeGroup name="TextAlign"> <xs:annotation> <xs:documentation> - text alignment for p, div, h1-h6. The default is + text alignment for p, div, h1-h5. The default is align="left" for ltr headings, "right" for rtl </xs:documentation> </xs:annotation> @@ -595,7 +595,6 @@ <xs:element ref="h3"/> <xs:element ref="h4"/> <xs:element ref="h5"/> - <xs:element ref="h6"/> </xs:choice> </xs:group> @@ -1007,7 +1006,7 @@ =================== Headings ========================================= There are six levels of headings from h1 (the most important) - to h6 (the least important). + to h5 (the least important). </xs:documentation> </xs:annotation> @@ -1066,17 +1065,6 @@ </xs:complexType> </xs:element> - <xs:element name="h6"> - <xs:complexType mixed="true"> - <xs:complexContent> - <xs:extension base="Inline"> - <xs:attributeGroup ref="attrs"/> - <xs:attributeGroup ref="TextAlign"/> - </xs:extension> - </xs:complexContent> - </xs:complexType> - </xs:element> - <xs:annotation> <xs:documentation> =================== Lists ============================================ @@ -2925,4 +2913,4 @@ <xs:attribute name="name" use="required" type="Text"/> </xs:complexType> </xs:element> -</xs:schema> \ No newline at end of file +</xs:schema> diff --git a/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java b/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java index eef74adf..5fb876cf 100644 --- a/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java +++ b/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java @@ -314,10 +314,10 @@ public class MarkdownParserTest List<SinkEventElement> eventList = parseFileToEventTestingSink( "metadata" ).getEventList(); Iterator<SinkEventElement> it = eventList.iterator(); - assertSinkEquals( it, "head", "title", "text", "text", "text", "title_", "author", "text", "author_", "date", "text", "date_", - "unknown", "head_", "body", "unknown", "text", "unknown", "paragraph", "text", "paragraph_", "section1", - "sectionTitle1", "text", "sectionTitle1_", "paragraph", "text", "paragraph_", "section1_", - "body_" ); + assertSinkEquals( it, "head", "title", "text", "text", "text", "title_", "author", "text", "author_", "date", + "text", "date_", "unknown", "head_", "body", "section1", "sectionTitle1", "text", "sectionTitle1_", + "paragraph", "text", "paragraph_", "section2", "sectionTitle2", "text", "sectionTitle2_", "paragraph", + "text", "paragraph_", "section2_", "section1_", "body_" ); assertFalse( it.hasNext() ); @@ -354,7 +354,6 @@ public class MarkdownParserTest { Iterator<SinkEventElement> it = parseFileToEventTestingSink( "first-heading" ).getEventList().iterator(); - // NOTE: H1 is rendered as "unknown" and H2 is "section1" (see DOXIA-203) assertSinkEquals( it, "head", "title", "text", "title_", "head_", "body", "comment", "text", "section1", "sectionTitle1", "text", "sectionTitle1_", "paragraph", "text", "paragraph_", "section1_", "body_" ); @@ -373,9 +372,8 @@ public class MarkdownParserTest { Iterator<SinkEventElement> it = parseFileToEventTestingSink( "comment-before-heading" ).getEventList().iterator(); - // NOTE: H1 is rendered as "unknown" and H2 is "section1" (see DOXIA-203) - assertSinkEquals( it, "head", "title", "text", "title_", "head_", "body", "comment", "text", "unknown", "text", - "unknown", "paragraph", "text", "link", "text", "link_", "text", "paragraph_", "body_" ); + assertSinkEquals( it, "head", "title", "text", "title_", "head_", "body", "comment", "text", "section1", + "sectionTitle1", "text", "sectionTitle1_", "paragraph", "text", "paragraph_", "section1_", "body_" ); assertFalse( it.hasNext() ); } @@ -391,13 +389,13 @@ public class MarkdownParserTest { Iterator<SinkEventElement> it = parseFileToEventTestingSink( "html-content" ).getEventList().iterator(); - // NOTE: H1 and DIV are rendered as "unknown" and H2 is "section1" (see DOXIA-203) + // NOTE: DIV are rendered as "unknown" (see DOXIA-203) assertSinkEquals( it, "head", "head_", "body", "unknown", "text", "paragraph", "inline", "text", - "inline_", "text", "inline", "text", "inline_", "text", "paragraph_", "text", "unknown", "text", "horizontalRule", "unknown", - "text", "unknown", "paragraph", "text", "paragraph_", "text", "table", "tableRows", "text", "tableRow", - "tableHeaderCell", "text", "tableHeaderCell_", "tableRow_", "text", "tableRow", - "tableCell", "text", "tableCell_", "tableRow_", "text", "tableRows_", "table_", - "body_" ); + "inline_", "text", "inline", "text", "inline_", "text", "paragraph_", "text", "unknown", "text", + "horizontalRule", "section1", "sectionTitle1", "text", "sectionTitle1_", "paragraph", "text", + "paragraph_", "text", "table", "tableRows", "text", "tableRow", "tableHeaderCell", "text", + "tableHeaderCell_", "tableRow_", "text", "tableRow", "tableCell", "text", "tableCell_", "tableRow_", + "text", "tableRows_", "table_", "section1_", "body_" ); assertFalse( it.hasNext() ); } @@ -472,13 +470,15 @@ public class MarkdownParserTest "listItem", "link", "text", "link_", "listItem_", // second section 2 TOC entry "list_", // TOC end "text", - "section1", "sectionTitle1", "text", "sectionTitle1_", - "section2", - "section3", "sectionTitle3", "text", "sectionTitle3_", + "section1", + "section2", "sectionTitle2", "text", "sectionTitle2_", + "section3", + "section4", "sectionTitle4", "text", "sectionTitle4_", + "section4_", "section3_", "section2_", - "section1_", - "section1", "sectionTitle1", "text", "sectionTitle1_", + "section2", "sectionTitle2", "text", "sectionTitle2_", + "section2_", "section1_", "body_" ); } diff --git a/doxia-modules/doxia-module-markdown/src/test/resources/comment-before-heading.md b/doxia-modules/doxia-module-markdown/src/test/resources/comment-before-heading.md index bc172157..693a09e2 100644 --- a/doxia-modules/doxia-module-markdown/src/test/resources/comment-before-heading.md +++ b/doxia-modules/doxia-module-markdown/src/test/resources/comment-before-heading.md @@ -21,5 +21,4 @@ Test document ============= This document verifies that an initial HTML comment block does not prevent the first heading -from being used as the document title. Currently the H1 headings are not rendered as sections by -Doxia (see [DOXIA-203](http://jira.codehaus.org/browse/DOXIA-203)). \ No newline at end of file +from being used as the document title. diff --git a/doxia-modules/doxia-module-markdown/src/test/resources/first-heading.md b/doxia-modules/doxia-module-markdown/src/test/resources/first-heading.md index 108f1996..ccd535bd 100644 --- a/doxia-modules/doxia-module-markdown/src/test/resources/first-heading.md +++ b/doxia-modules/doxia-module-markdown/src/test/resources/first-heading.md @@ -5,6 +5,6 @@ First heading -------------- +============= -Text \ No newline at end of file +Text diff --git a/doxia-modules/doxia-module-markdown/src/test/resources/macro-toc-DOXIA-559.md b/doxia-modules/doxia-module-markdown/src/test/resources/macro-toc-DOXIA-559.md index d5087204..a9a25667 100644 --- a/doxia-modules/doxia-module-markdown/src/test/resources/macro-toc-DOXIA-559.md +++ b/doxia-modules/doxia-module-markdown/src/test/resources/macro-toc-DOXIA-559.md @@ -1,5 +1,5 @@ -<!-- MACRO{toc|fromDepth=1|toDepth=2} --> +<!-- MACRO{toc|fromDepth=2|toDepth=3} --> ## level 2 diff --git a/doxia-modules/doxia-module-markdown/src/test/resources/macro-toc.md b/doxia-modules/doxia-module-markdown/src/test/resources/macro-toc.md index 70e14c99..20d807fa 100644 --- a/doxia-modules/doxia-module-markdown/src/test/resources/macro-toc.md +++ b/doxia-modules/doxia-module-markdown/src/test/resources/macro-toc.md @@ -1,6 +1,6 @@ <!-- MACRO{toc|fromDepth=1|toDepth=2} --> -### Subsection +## Subsection -### Another +## Another diff --git a/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java b/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java index 10d8a4d2..67dc1809 100644 --- a/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java +++ b/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java @@ -306,6 +306,8 @@ public class XdocParser else if ( parser.getName().equals( SUBSECTION_TAG.toString() ) ) { consecutiveSections( Sink.SECTION_LEVEL_1, sink ); + + // sink.section2_() not necessary } else if ( !baseEndTag( parser, sink ) ) { @@ -342,7 +344,7 @@ public class XdocParser } /** - * Close open h4, h5, h6 sections. + * Close open h2, h3, h4, h5 sections. */ private void closeOpenSections( int newLevel, Sink sink ) { @@ -483,7 +485,7 @@ public class XdocParser } /** - * Open missing h4, h5, h6 sections. + * Open missing h2, h3, h4, h5 sections. */ private void openMissingSections( int newLevel, Sink sink ) { diff --git a/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java b/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java index 96d85a93..ea0b871d 100644 --- a/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java +++ b/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java @@ -327,9 +327,9 @@ public class XdocSink * {@inheritDoc} * * Starts a section title. + * @see javax.swing.text.html.HTML.Tag#H3 * @see javax.swing.text.html.HTML.Tag#H4 * @see javax.swing.text.html.HTML.Tag#H5 - * @see javax.swing.text.html.HTML.Tag#H6 */ protected void onSectionTitle( int depth, SinkEventAttributes attributes ) { @@ -338,15 +338,15 @@ public class XdocSink if ( depth == SECTION_LEVEL_3 ) { - writeStartTag( H4, atts ); + writeStartTag( H3, atts ); } else if ( depth == SECTION_LEVEL_4 ) { - writeStartTag( H5, atts ); + writeStartTag( H4, atts ); } else if ( depth == SECTION_LEVEL_5 ) { - writeStartTag( H6, atts ); + writeStartTag( H5, atts ); } } @@ -354,9 +354,9 @@ public class XdocSink * {@inheritDoc} * * Ends a section title. + * @see javax.swing.text.html.HTML.Tag#H3 * @see javax.swing.text.html.HTML.Tag#H4 * @see javax.swing.text.html.HTML.Tag#H5 - * @see javax.swing.text.html.HTML.Tag#H6 */ protected void onSectionTitle_( int depth ) { @@ -366,15 +366,15 @@ public class XdocSink } else if ( depth == SECTION_LEVEL_3 ) { - writeEndTag( H4 ); + writeEndTag( H3 ); } else if ( depth == SECTION_LEVEL_4 ) { - writeEndTag( H5 ); + writeEndTag( H4 ); } else if ( depth == SECTION_LEVEL_5 ) { - writeEndTag( H6 ); + writeEndTag( H5 ); } } diff --git a/doxia-modules/doxia-module-xdoc/src/main/resources/xdoc-2.0.xsd b/doxia-modules/doxia-module-xdoc/src/main/resources/xdoc-2.0.xsd index ea72e322..f24886dc 100644 --- a/doxia-modules/doxia-module-xdoc/src/main/resources/xdoc-2.0.xsd +++ b/doxia-modules/doxia-module-xdoc/src/main/resources/xdoc-2.0.xsd @@ -419,7 +419,7 @@ <xs:attributeGroup name="TextAlign"> <xs:annotation> <xs:documentation> - text alignment for p, div, h1-h6. The default is + text alignment for p, div, h1-h5. The default is align="left" for ltr headings, "right" for rtl </xs:documentation> </xs:annotation> @@ -595,7 +595,6 @@ <xs:element ref="h3"/> <xs:element ref="h4"/> <xs:element ref="h5"/> - <xs:element ref="h6"/> </xs:choice> </xs:group> @@ -1007,7 +1006,7 @@ =================== Headings ========================================= There are six levels of headings from h1 (the most important) - to h6 (the least important). + to h5 (the least important). </xs:documentation> </xs:annotation> @@ -1066,17 +1065,6 @@ </xs:complexType> </xs:element> - <xs:element name="h6"> - <xs:complexType mixed="true"> - <xs:complexContent> - <xs:extension base="Inline"> - <xs:attributeGroup ref="attrs"/> - <xs:attributeGroup ref="TextAlign"/> - </xs:extension> - </xs:complexContent> - </xs:complexType> - </xs:element> - <xs:annotation> <xs:documentation> =================== Lists ============================================ @@ -2960,4 +2948,4 @@ <xs:attribute name="name" use="required" type="Text"/> </xs:complexType> </xs:element> -</xs:schema> \ No newline at end of file +</xs:schema> diff --git a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java index c1cbc579..7469c59a 100644 --- a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java +++ b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java @@ -265,7 +265,7 @@ public class XdocParserTest throws Exception { // DOXIA-241 - String text = "<section name=\"section\"><h6>h6</h6><subsection name=\"subsection\"></subsection></section>"; + String text = "<section name=\"section\"><h5>h5</h5><subsection name=\"subsection\"></subsection></section>"; Iterator<SinkEventElement> it = parseText( text ); @@ -421,32 +421,32 @@ public class XdocParserTest assertSinkEquals( it, "paragraph_", "section1_" ); } - + @Test public void testStyleWithCData() throws Exception { // DOXIA-449 - final String text = "<style type=\"text/css\">\n" + - "<![CDATA[\n" + - "h2 {\n" + - "font-size: 50px;\n" + - "}\n" + - "]]>\n" + - "</style>"; - + final String text = "<style type=\"text/css\">\n" + + "<![CDATA[\n" + + "h2 {\n" + + "font-size: 50px;\n" + + "}\n" + + "]]>\n" + + "</style>"; + SinkEventTestingSink sink = new SinkEventTestingSink(); parser.setValidate( false ); parser.parse( text, sink ); - + Iterator<SinkEventElement> it = sink.getEventList().iterator(); - SinkEventElement styleElm = it.next(); + SinkEventElement styleElm = it.next(); assertEquals( "unknown", styleElm.getName() ); assertEquals( "style", styleElm.getArgs()[0] ); - SinkEventElement cdataElm = it.next(); + SinkEventElement cdataElm = it.next(); assertEquals( "unknown", cdataElm.getName() ); assertEquals( "CDATA", cdataElm.getArgs()[0] ); - SinkEventElement styleElm_ = it.next(); + SinkEventElement styleElm_ = it.next(); assertEquals( "unknown", styleElm_.getName() ); assertEquals( "style", styleElm_.getArgs()[0] ); assertFalse( it.hasNext() ); diff --git a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java index f9259953..d33d5031 100644 --- a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java +++ b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java @@ -128,19 +128,19 @@ public class XdocSinkTest /** {@inheritDoc} */ protected String getSection3Block( String title ) { - return "<h4>" + title + "</h4>"; + return "<h3>" + title + "</h3>"; } /** {@inheritDoc} */ protected String getSection4Block( String title ) { - return "<h5>" + title + "</h5>"; + return "<h4>" + title + "</h4>"; } /** {@inheritDoc} */ protected String getSection5Block( String title ) { - return "<h6>" + title + "</h6>"; + return "<h5>" + title + "</h5>"; } /** {@inheritDoc} */ diff --git a/doxia-modules/doxia-module-xdoc/src/test/resources/test.xml b/doxia-modules/doxia-module-xdoc/src/test/resources/test.xml index 104539d8..d4fafcbe 100644 --- a/doxia-modules/doxia-module-xdoc/src/test/resources/test.xml +++ b/doxia-modules/doxia-module-xdoc/src/test/resources/test.xml @@ -36,9 +36,9 @@ <section name="Section title"> <subsection name="Sub-section title"> - <h4>Sub-sub-section title</h4> - <h5>Sub-sub-sub-section</h5> - <h6>Sub-sub-sub-sub-section</h6> + <h3>Sub-sub-section title</h3> + <h4>Sub-sub-sub-section</h4> + <h5>Sub-sub-sub-sub-section</h5> <ul> <li>List item 1.</li> diff --git a/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java b/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java index c63aed68..43249f6c 100644 --- a/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java +++ b/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java @@ -151,31 +151,31 @@ public class XhtmlSinkTest /** {@inheritDoc} */ protected String getSection1Block( String title ) { - return "<div class=\"section\">\n<h2>" + title + "</h2></div>"; + return "<div class=\"section\">\n<h1>" + title + "</h1></div>"; } /** {@inheritDoc} */ protected String getSection2Block( String title ) { - return "<div class=\"section\">\n<h3>" + title + "</h3></div>"; + return "<div class=\"section\">\n<h2>" + title + "</h2></div>"; } /** {@inheritDoc} */ protected String getSection3Block( String title ) { - return "<div class=\"section\">\n<h4>" + title + "</h4></div>"; + return "<div class=\"section\">\n<h3>" + title + "</h3></div>"; } /** {@inheritDoc} */ protected String getSection4Block( String title ) { - return "<div class=\"section\">\n<h5>" + title + "</h5></div>"; + return "<div class=\"section\">\n<h4>" + title + "</h4></div>"; } /** {@inheritDoc} */ protected String getSection5Block( String title ) { - return "<div class=\"section\">\n<h6>" + title + "</h6></div>"; + return "<div class=\"section\">\n<h5>" + title + "</h5></div>"; } /** {@inheritDoc} */ @@ -412,7 +412,7 @@ public class XhtmlSinkTest sink.close(); } - assertEquals( "<div class=\"section\">\n<h2>&</h2>\n<p>&</p></div>", writer.toString() ); + assertEquals( "<div class=\"section\">\n<h1>&</h1>\n<p>&</p></div>", writer.toString() ); } /** diff --git a/doxia-modules/doxia-module-xhtml/src/test/resources/fun.html b/doxia-modules/doxia-module-xhtml/src/test/resources/fun.html index d8f2cd36..3f8b39a1 100644 --- a/doxia-modules/doxia-module-xhtml/src/test/resources/fun.html +++ b/doxia-modules/doxia-module-xhtml/src/test/resources/fun.html @@ -34,7 +34,7 @@ under the License. <p> This paragraph belongs to subsection two. </p> - <h4>This is the first third-level section</h4> + <h3>This is the first third-level section</h3> <p> To make the <em>task</em> <i>even</i> harder, the <tt>h3</tt>-heading was dropped, but we diff --git a/doxia-modules/doxia-module-xhtml/src/test/resources/index.xml.vm b/doxia-modules/doxia-module-xhtml/src/test/resources/index.xml.vm index 96d7597b..f6c942b4 100644 --- a/doxia-modules/doxia-module-xhtml/src/test/resources/index.xml.vm +++ b/doxia-modules/doxia-module-xhtml/src/test/resources/index.xml.vm @@ -29,7 +29,7 @@ under the License. <!-- TODO: news? --> <div id="downloadbox"> - <h5>Search Maven Sites</h5> + <h4>Search Maven Sites</h4> <!-- Google CSE Search Box Begins --> <form action="http://www.google.com/cse" id="searchbox_006660305041243700248:hyqtfwsewpm"> <input type="hidden" name="cx" value="006660305041243700248:hyqtfwsewpm" /> @@ -39,7 +39,7 @@ under the License. <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_006660305041243700248%3Ahyqtfwsewpm"></script> <!-- Google CSE Search Box Ends --> - <h5>Get Maven ${currentVersion}</h5> + <h4>Get Maven ${currentVersion}</h4> <span style="display: block; text-align: right; font-size: smaller">Released: 20 June 2007</span> <p> <a href="download.html"> @@ -68,7 +68,7 @@ under the License. </p> <!-- TODO: what about downloads for Continuum, etc.? Would be good to have one big download page --> - <h5>Other Maven Projects</h5> + <h4>Other Maven Projects</h4> <p> <a href="/continuum/"> <img src="images/continuum.png" border="0" width="76" height="32" style="float: left; margin-right: 1em;" alt="" title="Continuum" /> @@ -77,16 +77,16 @@ under the License. continuous integration server </p> <!-- - + You can't be promoting Archiva when it's never been released, it's completely alpha and this is misleading. When it's released I think it can rightfully be put here. - + <p> <a href="archiva"> <img src="images/archiva.png" border="0" width="76" height="32" style="float: left; margin-right: 1em;" alt="" title="Archiva" /> Archiva </a> - repository and artifact management server + repository and artifact management server </p> --> <p> @@ -118,7 +118,7 @@ width="244" height="68"></iframe> a <a href="maven-features.html">list of some of its main features</a>, and a set of <a href="general.html">frequently asked questions about what Maven is</a>. </p> - <h3>Learning about Maven</h3> + <h2>Learning about Maven</h2> <p> <!-- TODO: this could be the big button type thing instead of a list of links --> This site is separated into the following sections, depending on how you'd like to use Maven: @@ -177,7 +177,7 @@ width="244" height="68"></iframe> <p> You can access the guides at any time from the left navigation. </p> - <h3>Documentation Index</h3> + <h2>Documentation Index</h2> <p> If you are looking for a quick reference, you can use the <a href="guides/index.html">documentation index.</a> <!-- TODO @@ -185,7 +185,7 @@ width="244" height="68"></iframe> <a href="todo.html">alphabetical</a> and <a href="todo.html">categorical</a> listing formats. --> </p> - <h3>Plugins</h3> + <h2>Plugins</h2> <!-- TODO <p> Maven functionality is provided by plugins. For an explanation of how plugins work, and basic information on how @@ -197,7 +197,7 @@ width="244" height="68"></iframe> <a href="plugins/index.html">plugin list</a>. </p> <!-- TODO: Should these be here, or just in the user centre? - <h3>Converting from a different Build System</h3> + <h2>Converting from a different Build System</h2> <p> If you are currently using a different build system, there are options for converting from that to Maven 2 either partially or completely. These guides also give an overview of the differences between Maven and the @@ -209,7 +209,7 @@ width="244" height="68"></iframe> <li><a href="todo.html">Adding Maven 2 to an IDE based build</a></li> </ul> --> - <h3>How to Get Support</h3> + <h2>How to Get Support</h2> <p> Support for Maven is available in a variety of different forms. </p> diff --git a/doxia-modules/doxia-module-xhtml/src/test/resources/test.xhtml b/doxia-modules/doxia-module-xhtml/src/test/resources/test.xhtml index f9d07c3b..fd94454c 100644 --- a/doxia-modules/doxia-module-xhtml/src/test/resources/test.xhtml +++ b/doxia-modules/doxia-module-xhtml/src/test/resources/test.xhtml @@ -34,11 +34,11 @@ under the License. <p>Paragraph 1, line 1. Paragraph 1, line 2.</p> <p>Paragraph 2, line 1. Paragraph 2, line 2.</p> -<div class="section"><h2>Section title</h2> -<div class="section"><h3>Sub-section title</h3> -<div class="section"><h4>Sub-sub-section title</h4> -<div class="section"><h5>Sub-sub-sub-section title</h5> -<div class="section"><h6>Sub-sub-sub-sub-section title</h6> +<div class="section"><h1>Section title</h1> +<div class="section"><h2>Sub-section title</h2> +<div class="section"><h3>Sub-sub-section title</h3> +<div class="section"><h4>Sub-sub-sub-section title</h4> +<div class="section"><h5>Sub-sub-sub-sub-section title</h5> <ul> <li>List item 1.</li> diff --git a/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5Sink.java b/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5Sink.java index 11783171..8c570bfe 100644 --- a/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5Sink.java +++ b/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5Sink.java @@ -279,11 +279,11 @@ public class Xhtml5Sink * {@inheritDoc} * * Starts a section title. + * @see javax.swing.text.html.HTML.Tag#H1 * @see javax.swing.text.html.HTML.Tag#H2 * @see javax.swing.text.html.HTML.Tag#H3 * @see javax.swing.text.html.HTML.Tag#H4 * @see javax.swing.text.html.HTML.Tag#H5 - * @see javax.swing.text.html.HTML.Tag#H6 */ protected void onSectionTitle( int depth, SinkEventAttributes attributes ) { @@ -292,23 +292,23 @@ public class Xhtml5Sink if ( depth == SECTION_LEVEL_1 ) { - writeStartTag( HtmlMarkup.H2, atts ); + writeStartTag( HtmlMarkup.H1, atts ); } else if ( depth == SECTION_LEVEL_2 ) { - writeStartTag( HtmlMarkup.H3, atts ); + writeStartTag( HtmlMarkup.H2, atts ); } else if ( depth == SECTION_LEVEL_3 ) { - writeStartTag( HtmlMarkup.H4, atts ); + writeStartTag( HtmlMarkup.H3, atts ); } else if ( depth == SECTION_LEVEL_4 ) { - writeStartTag( HtmlMarkup.H5, atts ); + writeStartTag( HtmlMarkup.H4, atts ); } else if ( depth == SECTION_LEVEL_5 ) { - writeStartTag( HtmlMarkup.H6, atts ); + writeStartTag( HtmlMarkup.H5, atts ); } } @@ -316,33 +316,33 @@ public class Xhtml5Sink * {@inheritDoc} * * Ends a section title. + * @see javax.swing.text.html.HTML.Tag#H1 * @see javax.swing.text.html.HTML.Tag#H2 * @see javax.swing.text.html.HTML.Tag#H3 * @see javax.swing.text.html.HTML.Tag#H4 * @see javax.swing.text.html.HTML.Tag#H5 - * @see javax.swing.text.html.HTML.Tag#H6 */ protected void onSectionTitle_( int depth ) { if ( depth == SECTION_LEVEL_1 ) { - writeEndTag( HtmlMarkup.H2 ); + writeEndTag( HtmlMarkup.H1 ); } else if ( depth == SECTION_LEVEL_2 ) { - writeEndTag( HtmlMarkup.H3 ); + writeEndTag( HtmlMarkup.H2 ); } else if ( depth == SECTION_LEVEL_3 ) { - writeEndTag( HtmlMarkup.H4 ); + writeEndTag( HtmlMarkup.H3 ); } else if ( depth == SECTION_LEVEL_4 ) { - writeEndTag( HtmlMarkup.H5 ); + writeEndTag( HtmlMarkup.H4 ); } else if ( depth == SECTION_LEVEL_5 ) { - writeEndTag( HtmlMarkup.H6 ); + writeEndTag( HtmlMarkup.H5 ); } } diff --git a/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5SinkTest.java b/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5SinkTest.java index 59cc67c0..093db562 100644 --- a/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5SinkTest.java +++ b/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5SinkTest.java @@ -148,31 +148,31 @@ public class Xhtml5SinkTest /** {@inheritDoc} */ protected String getSection1Block( String title ) { - return "<section><header>\n<h2>" + title + "</h2></header></section>"; + return "<section><header>\n<h1>" + title + "</h1></header></section>"; } /** {@inheritDoc} */ protected String getSection2Block( String title ) { - return "<section><header>\n<h3>" + title + "</h3></header></section>"; + return "<section><header>\n<h2>" + title + "</h2></header></section>"; } /** {@inheritDoc} */ protected String getSection3Block( String title ) { - return "<section><header>\n<h4>" + title + "</h4></header></section>"; + return "<section><header>\n<h3>" + title + "</h3></header></section>"; } /** {@inheritDoc} */ protected String getSection4Block( String title ) { - return "<section><header>\n<h5>" + title + "</h5></header></section>"; + return "<section><header>\n<h4>" + title + "</h4></header></section>"; } /** {@inheritDoc} */ protected String getSection5Block( String title ) { - return "<section><header>\n<h6>" + title + "</h6></header></section>"; + return "<section><header>\n<h5>" + title + "</h5></header></section>"; } /** {@inheritDoc} */ @@ -407,7 +407,7 @@ public class Xhtml5SinkTest sink.close(); } - assertEquals( "<section><header>\n<h2>&</h2></header>\n<p>&</p></section>", writer.toString() ); + assertEquals( "<section><header>\n<h1>&</h1></header>\n<p>&</p></section>", writer.toString() ); } /** diff --git a/doxia-modules/doxia-module-xhtml5/src/test/resources/fun.html b/doxia-modules/doxia-module-xhtml5/src/test/resources/fun.html index 059aca59..e0fdf93b 100644 --- a/doxia-modules/doxia-module-xhtml5/src/test/resources/fun.html +++ b/doxia-modules/doxia-module-xhtml5/src/test/resources/fun.html @@ -34,7 +34,7 @@ under the License. <p> This paragraph belongs to subsection two. </p> - <h4>This is the first third-level section</h4> + <h3>This is the first third-level section</h3> <p> To make the <em>task</em> <i>even</i> harder, the <tt>h3</tt>-heading was dropped, but we diff --git a/doxia-modules/doxia-module-xhtml5/src/test/resources/index.xml.vm b/doxia-modules/doxia-module-xhtml5/src/test/resources/index.xml.vm index 0050c118..4c56c01e 100644 --- a/doxia-modules/doxia-module-xhtml5/src/test/resources/index.xml.vm +++ b/doxia-modules/doxia-module-xhtml5/src/test/resources/index.xml.vm @@ -29,7 +29,7 @@ under the License. <!-- TODO: news? --> <div id="downloadbox"> - <h5>Search Maven Sites</h5> + <h4>Search Maven Sites</h4> <!-- Google CSE Search Box Begins --> <form action="http://www.google.com/cse" id="searchbox_006660305041243700248:hyqtfwsewpm"> <input type="hidden" name="cx" value="006660305041243700248:hyqtfwsewpm" /> @@ -39,7 +39,7 @@ under the License. <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_006660305041243700248%3Ahyqtfwsewpm"></script> <!-- Google CSE Search Box Ends --> - <h5>Get Maven ${currentVersion}</h5> + <h4>Get Maven ${currentVersion}</h4> <span style="display: block; text-align: right; font-size: smaller">Released: 20 June 2007</span> <p> <a href="download.html"> @@ -68,7 +68,7 @@ under the License. </p> <!-- TODO: what about downloads for Continuum, etc.? Would be good to have one big download page --> - <h5>Other Maven Projects</h5> + <h4>Other Maven Projects</h4> <p> <a href="/continuum/"> <img src="images/continuum.png" border="0" width="76" height="32" style="float: left; margin-right: 1em;" alt="" title="Continuum" /> @@ -118,7 +118,7 @@ width="244" height="68"></iframe> a <a href="maven-features.html">list of some of its main features</a>, and a set of <a href="general.html">frequently asked questions about what Maven is</a>. </p> - <h3>Learning about Maven</h3> + <h2>Learning about Maven</h2> <p> <!-- TODO: this could be the big button type thing instead of a list of links --> This site is separated into the following sections, depending on how you'd like to use Maven: @@ -177,7 +177,7 @@ width="244" height="68"></iframe> <p> You can access the guides at any time from the left navigation. </p> - <h3>Documentation Index</h3> + <h2>Documentation Index</h2> <p> If you are looking for a quick reference, you can use the <a href="guides/index.html">documentation index.</a> <!-- TODO @@ -185,7 +185,7 @@ width="244" height="68"></iframe> <a href="todo.html">alphabetical</a> and <a href="todo.html">categorical</a> listing formats. --> </p> - <h3>Plugins</h3> + <h2>Plugins</h2> <!-- TODO <p> Maven functionality is provided by plugins. For an explanation of how plugins work, and basic information on how @@ -197,7 +197,7 @@ width="244" height="68"></iframe> <a href="plugins/index.html">plugin list</a>. </p> <!-- TODO: Should these be here, or just in the user centre? - <h3>Converting from a different Build System</h3> + <h2>Converting from a different Build System</h2> <p> If you are currently using a different build system, there are options for converting from that to Maven 2 either partially or completely. These guides also give an overview of the differences between Maven and the @@ -209,7 +209,7 @@ width="244" height="68"></iframe> <li><a href="todo.html">Adding Maven 2 to an IDE based build</a></li> </ul> --> - <h3>How to Get Support</h3> + <h2>How to Get Support</h2> <p> Support for Maven is available in a variety of different forms. </p> diff --git a/doxia-modules/doxia-module-xhtml5/src/test/resources/test.xhtml b/doxia-modules/doxia-module-xhtml5/src/test/resources/test.xhtml index e7392e53..5e4fa810 100644 --- a/doxia-modules/doxia-module-xhtml5/src/test/resources/test.xhtml +++ b/doxia-modules/doxia-module-xhtml5/src/test/resources/test.xhtml @@ -34,11 +34,11 @@ under the License. <p>Paragraph 1, line 1. Paragraph 1, line 2.</p> <p>Paragraph 2, line 1. Paragraph 2, line 2.</p> -<section><h2>Section title</h2> -<section><h3>Sub-section title</h3> -<section><h4>Sub-sub-section title</h4> -<section><h5>Sub-sub-sub-section title</h5> -<section><h6>Sub-sub-sub-sub-section title</h6> +<section><h1>Section title</h1> +<section><h2>Sub-section title</h2> +<section><h3>Sub-sub-section title</h3> +<section><h4>Sub-sub-sub-section title</h4> +<section><h5>Sub-sub-sub-sub-section title</h5> <ul> <li>List item 1.</li> diff --git a/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java b/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java index 32682628..6f90503c 100644 --- a/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java +++ b/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java @@ -116,12 +116,6 @@ public interface Sink */ int SECTION_LEVEL_5 = 5; - /** - * A level 5 section (sub-sub-sub-subsection). - * @see #section(int,SinkEventAttributes) - */ - int SECTION_LEVEL_6 = 6; - /** * Center alignment for table cells. * @see #tableRows(int[], boolean) @@ -523,38 +517,6 @@ public interface Sink */ void sectionTitle5_(); - /** - * Starts a 6th heading element which contains the topic of the section. - * This has to be contained within a {@link #section5()} element. - * - * @see #section(int,SinkEventAttributes) - * @since 1.7 - */ - void section6(); - - /** - * Ends a 6th heading element. - * - * @since 1.7 - */ - void section6_(); - - /** - * Starts a 6th title heading element. This element is optional, but if it exists, - * it has to be contained, and be the first element, within a {@link #section6()} element. - * - * @see #sectionTitle(int,SinkEventAttributes) - * @since 1.7 - */ - void sectionTitle6(); - - /** - * Ends a 6th title heading element. - * - * @since 1.7 - */ - void sectionTitle6_(); - /** * Start a new section at the given level. * diff --git a/doxia-test-docs/src/main/resources/doxia-site/xdoc/references/xdoc-format.xml b/doxia-test-docs/src/main/resources/doxia-site/xdoc/references/xdoc-format.xml index 14a73c62..4de6e3bb 100644 --- a/doxia-test-docs/src/main/resources/doxia-site/xdoc/references/xdoc-format.xml +++ b/doxia-test-docs/src/main/resources/doxia-site/xdoc/references/xdoc-format.xml @@ -101,21 +101,21 @@ code line 2 <subsection name="Additional sectioning"> <p> - Doxia will produce <code><h2></code> and - <code><h3></code> headings for <code><section></code> + Doxia will produce <code><h1></code> and + <code><h2></code> headings for <code><section></code> and <code><subsection></code> elements, respectively. It is therefore perfectly valid to put some sub-headings - (<code><h4></code>, <code><h5></code>, - <code><h6></code>) inside a subsection. For instance, + (<code><h3></code>, <code><h4></code>, + <code><h5></code>) inside a subsection. For instance, </p> - <source><![CDATA[<h4>A subsubsection</h4>]]></source> + <source><![CDATA[<h3>A subsubsection</h3>]]></source> <p> will produce: </p> - <h4>A subsubsection</h4> + <h3>A subsubsection</h3> </subsection> diff --git a/doxia-test-docs/src/main/resources/maven-site/xdoc/developers/mojo-api-specification.xml b/doxia-test-docs/src/main/resources/maven-site/xdoc/developers/mojo-api-specification.xml index 184abd34..49285c0a 100644 --- a/doxia-test-docs/src/main/resources/maven-site/xdoc/developers/mojo-api-specification.xml +++ b/doxia-test-docs/src/main/resources/maven-site/xdoc/developers/mojo-api-specification.xml @@ -102,7 +102,7 @@ under the License. logging mechanism which will allow the Mojo to communicate to the outside world through standard Maven channels. </p> - <h6>Method Summary:</h6> + <h5>Method Summary:</h5> <ul> <li> <code> @@ -145,7 +145,7 @@ under the License. , to furnish Log access to these concrete implementations. </p> - <h6>Method Summary:</h6> + <h5>Method Summary:</h5> <ul> <li> <code> @@ -196,7 +196,7 @@ under the License. <code>toString()</code> . </p> - <h6>Method Summary:</h6> + <h5>Method Summary:</h5> <ul> <li> <code>void debug( java.lang.CharSequence )</code>
