You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by bd...@apache.org on 2003/10/14 13:54:40 UTC
cvs commit: cocoon-2.1/src/blocks/slop/samples/yapt/stylesheets filter-slop-output.xsl html-slides.xsl
bdelacretaz 2003/10/14 04:54:40
Modified: src/blocks/slop/samples/yapt sitemap.xmap
src/blocks/slop/samples/yapt/presentations yapt-demo.txt
src/blocks/slop/samples/yapt/stylesheets
filter-slop-output.xsl html-slides.xsl
Log:
use slop preserve-space option to preserve indentation in code blocks
Revision Changes Path
1.4 +1 -0 cocoon-2.1/src/blocks/slop/samples/yapt/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/slop/samples/yapt/sitemap.xmap,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sitemap.xmap 13 Oct 2003 20:21:33 -0000 1.3
+++ sitemap.xmap 14 Oct 2003 11:54:40 -0000 1.4
@@ -59,6 +59,7 @@
<map:match pattern="presentations/**/xml/presentation">
<map:generate label="raw-content" type="slop" src="presentations/{1}.txt">
<map:parameter name="encoding" value="iso-8859-1"/>
+ <map:parameter name="preserve-space" value="true"/>
</map:generate>
<map:transform src="stylesheets/filter-slop-output.xsl"/>
<map:serialize type="xml"/>
1.5 +15 -2 cocoon-2.1/src/blocks/slop/samples/yapt/presentations/yapt-demo.txt
Index: yapt-demo.txt
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/slop/samples/yapt/presentations/yapt-demo.txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- yapt-demo.txt 11 Oct 2003 22:37:11 -0000 1.4
+++ yapt-demo.txt 14 Oct 2003 11:54:40 -0000 1.5
@@ -46,9 +46,22 @@
code:
<?xml version="1.0"?>
+ <some-element-here attrib="yes">
+ <child-element-indented/>
+ </some-element-ends>
<foo/>
-You'll find out that indenting is dropped, which is bad.
+Here we use the "preserve-space" option of the slop parser to preserve indentation.
+
+Currently, code cannot contain blank lines, it would be better to use an "endcode:" marker for the end:
+
+code:
+public class SomeJavaClass {
+ // the whole thing up to closing } should be in one block
+
+ // this follows a blank line
+}
+
slide: Test results
1.7 +2 -2 cocoon-2.1/src/blocks/slop/samples/yapt/stylesheets/filter-slop-output.xsl
Index: filter-slop-output.xsl
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/slop/samples/yapt/stylesheets/filter-slop-output.xsl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- filter-slop-output.xsl 13 Oct 2003 18:23:45 -0000 1.6
+++ filter-slop-output.xsl 14 Oct 2003 11:54:40 -0000 1.7
@@ -184,7 +184,7 @@
<!-- images are defined like "img_XX: filename" where XX is the CSS class -->
<xsl:template mode="paragraph" match="slop:*[starts-with(name(),'img')]">
<xsl:variable name="class" select="substring-after(name(),'img_')"/>
- <img src="{.}" alt="{.}" class="{$class}"/>
+ <img src="{normalize-space(.)}" alt="{normalize-space(.)}" class="{$class}"/>
</xsl:template>
</xsl:stylesheet>
1.5 +2 -2 cocoon-2.1/src/blocks/slop/samples/yapt/stylesheets/html-slides.xsl
Index: html-slides.xsl
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/slop/samples/yapt/stylesheets/html-slides.xsl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- html-slides.xsl 27 Sep 2003 19:12:05 -0000 1.4
+++ html-slides.xsl 14 Oct 2003 11:54:40 -0000 1.5
@@ -12,7 +12,7 @@
<xsl:import href="heading.xsl"/>
<!-- path to images -->
- <xsl:variable name="imagePath" select="concat('../../',/yapt-presentation/heading/image-directory,'/')"/>
+ <xsl:variable name="imagePath" select="concat('../../',normalize-space(/yapt-presentation/heading/image-directory),'/')"/>
<!-- single or multi-slide display? -->
<xsl:variable name="slideCount" select="count(/yapt-presentation/content/slide)"/>