stephan 2003/03/27 08:17:53
Modified: src/blocks/chaperon/samples sitemap.xmap
src/blocks/chaperon/samples/grammars wiki.grm
src/blocks/chaperon/samples/stylesheets wiki2xdoc.xsl
xdoc2html.xsl
src/blocks/chaperon/samples/wikitest selftest.txt
Log:
Nested sections should now work properly.
Revision Changes Path
1.6 +1 -1 cocoon-2.1/src/blocks/chaperon/samples/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/chaperon/samples/sitemap.xmap,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- sitemap.xmap 27 Mar 2003 13:12:21 -0000 1.5
+++ sitemap.xmap 27 Mar 2003 16:17:51 -0000 1.6
@@ -49,7 +49,7 @@
src="org.apache.cocoon.transformation.ParserTransformer"
logger="sitemap.transformer.parser">
<parameter name="flatten" value="true"/>
- <parameter name="ignoring" value="true"/>
+<!-- <parameter name="ignoring" value="true"/>-->
</map:transformer>
</map:transformers>
1.3 +48 -7 cocoon-2.1/src/blocks/chaperon/samples/grammars/wiki.grm
Index: wiki.grm
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/chaperon/samples/grammars/wiki.grm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- wiki.grm 27 Mar 2003 13:12:21 -0000 1.2
+++ wiki.grm 27 Mar 2003 16:17:51 -0000 1.3
@@ -10,7 +10,9 @@
%token tabletitleitem "\|\|";
%token tablecolumnitem "\|";
-%token titleitem "!+";
+%token titleitem "!";
+%token subtitleitem "!!";
+%token subsubtitleitem "!!!";
%token emitem "''";
@@ -28,7 +30,7 @@
%token text "([^\ \t\n\r\[\{\}\|\*\\\-_!#'] | _[^_\n\r] | \{[^\{\n\r] |
\}[^\}\n\r] | '[^'\n\r]
| \[\[ | \\[^\\\n\r] |
\-{1,3}[^\-\n\r]?)
([^ \n\r\[\{\}\|\\\-_'] | _[^_\n\r] | \{[^\{\n\r] |
\}[^\}\n\r] | '[^'\n\r]
- | \[\[ | \\[^\\\n\r] |
\-{1,3}[^\-\n\r]? | \|[^\ | \ \t])*";
+ | \[\[ | \\[^\\\n\r] |
\-{1,3}[^\-\n\r]? | \|[^\|\ \t])*";
%right softbreak "\r(\n?) | \n";
@@ -51,7 +53,10 @@
section
: title paragraphs
| title hardbreak paragraphs
- | title
+ ;
+
+title
+ : titleitem textsequence
;
paragraphs
@@ -59,6 +64,46 @@
| paragraphs paragraph
| paragraph hardbreak
| paragraph
+ | paragraphs subsection hardbreak
+ | paragraphs subsection
+ | subsection hardbreak
+ | subsection
+ ;
+
+subsection
+ : subtitle subparagraphs
+ | subtitle hardbreak subparagraphs
+ ;
+
+subtitle
+ : subtitleitem textsequence
+ ;
+
+subparagraphs
+ : subparagraphs paragraph hardbreak
+ | subparagraphs paragraph
+ | paragraph hardbreak
+ | paragraph
+ | subparagraphs subsubsection hardbreak
+ | subparagraphs subsubsection
+ | subsubsection hardbreak
+ | subsubsection
+ ;
+
+subsubsection
+ : subsubtitle subsubparagraphs
+ | subsubtitle hardbreak subsubparagraphs
+ ;
+
+subsubtitle
+ : subsubtitleitem textsequence
+ ;
+
+subsubparagraphs
+ : subsubparagraphs paragraph hardbreak
+ | subsubparagraphs paragraph
+ | paragraph hardbreak
+ | paragraph
;
paragraph
@@ -139,10 +184,6 @@
: tablecolumnitem textblock
;
-title
- : titleitem textsequence
- ;
-
textsequence
: textsequence textblock softbreak
| textsequence textblock
1.3 +15 -1 cocoon-2.1/src/blocks/chaperon/samples/stylesheets/wiki2xdoc.xsl
Index: wiki2xdoc.xsl
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/chaperon/samples/stylesheets/wiki2xdoc.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- wiki2xdoc.xsl 27 Mar 2003 13:12:21 -0000 1.2
+++ wiki2xdoc.xsl 27 Mar 2003 16:17:51 -0000 1.3
@@ -25,7 +25,21 @@
<xsl:template match="st:section">
<section>
<title><xsl:value-of select="st:title/st:textsequence"/></title>
- <xsl:apply-templates select="st:paragraphs/st:paragraph/st:*" mode="paragraph"/>
+ <xsl:apply-templates
select="st:paragraphs/st:paragraph/st:*|st:paragraphs/st:subsection" mode="paragraph"/>
+ </section>
+ </xsl:template>
+
+ <xsl:template match="st:subsection" mode="paragraph">
+ <section>
+ <title><xsl:value-of select="st:subtitle/st:textsequence"/></title>
+ <xsl:apply-templates
select="st:subparagraphs/st:paragraph/st:*|st:subparagraphs/st:subsubsection"
mode="paragraph"/>
+ </section>
+ </xsl:template>
+
+ <xsl:template match="st:subsubsection" mode="paragraph">
+ <section>
+ <title><xsl:value-of select="st:subsubtitle/st:textsequence"/></title>
+ <xsl:apply-templates select="st:subsubparagraphs/st:paragraph/st:*"
mode="paragraph"/>
</section>
</xsl:template>
1.2 +11 -1 cocoon-2.1/src/blocks/chaperon/samples/stylesheets/xdoc2html.xsl
Index: xdoc2html.xsl
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/chaperon/samples/stylesheets/xdoc2html.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xdoc2html.xsl 9 Mar 2003 00:02:59 -0000 1.1
+++ xdoc2html.xsl 27 Mar 2003 16:17:51 -0000 1.2
@@ -16,7 +16,17 @@
</xsl:template>
<xsl:template match="section">
- <h3><xsl:value-of select="title"/></h3>
+ <xsl:choose> <!-- stupid test for the hirachy deep -->
+ <xsl:when test="../../../section">
+ <h5><xsl:value-of select="title"/></h5>
+ </xsl:when>
+ <xsl:when test="../../section">
+ <h4><xsl:value-of select="title"/></h4>
+ </xsl:when>
+ <xsl:when test="../section">
+ <h3><xsl:value-of select="title"/></h3>
+ </xsl:when>
+ </xsl:choose>
<p>
<xsl:apply-templates select="*[name()!='title']"/>
</p>
1.4 +0 -2 cocoon-2.1/src/blocks/chaperon/samples/wikitest/selftest.txt
Index: selftest.txt
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/chaperon/samples/wikitest/selftest.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- selftest.txt 27 Mar 2003 13:12:21 -0000 1.3
+++ selftest.txt 27 Mar 2003 16:17:52 -0000 1.4
@@ -17,8 +17,6 @@
As of March 27th, 2003, the following tests fail:
* 0.1 This bullet list is invisible in the html output if there is no section title
before it
-* Headings are not nested as they should (use cocoon-view=xdoc to check xdocs XML
output)
-* 1.2, heading is interpreted as text under heading 1.1
* 5.1 relative link points to wiki.cocoondev.org (but is it by design?)
-- 1.HEADINGS --