On Sep 11, 2004, at 4:14 AM, Charles Palmer wrote:
> Hi Clay
>
> I suspect it is a combination of two things: how the lines are
> terminated in
> your original source code,and then how the
> openoffice-writer2forrest.xsl
> style sheet processes these line endings.
[...]
I was able to work around this problem by deleting the carriage-returns
inside the Forrest: Source block, then holding the [shift] key while
pressing [return] for each one. I do have some strange behavior, still
(extra breaks), but I should be able to get by this way...
However, I intend to check into the openoffice-writer2forrest.xsl file
and see if I can come up with a 'real' fix.
> Have a look at the content of your OOo document (you can do this by
> unzipping the .sxw file and examining the XML in content.xml). The
> source
> box example in Forrest's seed site looks like this:
>
> <text:p text:style-name="Forrest: Source">// source code:
> <source>...</source><text:line-break/>import
> org.apache.cocoon.*;<text:line-break/>...</text:p>
>
> In the OOo document I made a copy of this and added a "carriage
> return" at
> the end of the first two lines. In the OOo document the modified code
> stayed
> within a single source box, but the page rendered by Forrest ended up
> with
> three individual source boxes, as you report. The modified OOo document
> contains this:
>
> <text:p text:style-name="Forrest: Source">// source code:
> <source>...</source></text:p>
> <text:p text:style-name="Forrest: Source"><text:line-break/>import
> org.apache.cocoon.*;<text:line-break/></text:p>
> <text:p text:style-name="Forrest: Source">...</text:p>
>
> So in the modified case we end up with three "paragraphs" in the
> "Forrest:source" style, which Forrest puts into individual boxes,
> (while OOo
> recognises that they should be kept within one).
Here's a section of the document I created:
(optional) MAXFILES Max # files to process
<text:line-break />
<text:s text:c="3" />
(optional) IGNOREIMAGENAME Do not check to see if Bill exists in
<text:line-break />
<text:s />
</text:span>
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="T8">
<text:s text:c="2" />
</text:span>
</text:span>
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="T8">
<text:s text:c="2" />
</text:span>
</text:span>
</text:span>
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="T8">
<text:s text:c="2" />
</text:span>
</text:span>
</text:span>
</text:span>
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="T8">
<text:s text:c="2" />
</text:span>
</text:span>
</text:span>
</text:span>
</text:span>
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="T8">
<text:s text:c="2" />
</text:span>
</text:span>
</text:span>
</text:span>
</text:span>
</text:span>
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="T8">
<text:s text:c="2" />
</text:span>
</text:span>
</text:span>
</text:span>
</text:span>
</text:span>
</text:span>
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="Forrest: Code">
<text:span text:style-name="T8">
<text:s />
</text:span>
</text:span>
</text:span>
</text:span>
</text:span>
</text:span>
</text:span>
</text:span>
<text:span text:style-name="T8">
system
<text:line-break />
<text:s text:c="3" />
(optional) IGNOREDATE Do not check to see if
<text:line-break />
<text:s />
</text:span>
NOTE: Between 'Bill exists in' and 'system' there is a 'soft' return
([shift]+[return]) and 8-10 spaces. I need the soft-returns, because
without them, the page gets too wide.
I noticed that spaces are colored differently depending on whether the
[option] key (at least for Mac OS X--I don't know about other OSes) is
down.
In the end, I discovered:
- 'soft' returns require [option]+[return]
- 'hard' spaces (those which are never ignored) require [option]+[space]
- complete a thought in one line without 'softwarpping' (if text
overflows to the next line I have problems--for an example of what I'm
referring to, in your e-mail client, this line is probably filling up
two or three lines, 'soft-wrapping' a couple of times)
In the end, I am able to achieve the output I'm looking for. Keeping in
mind the above discoveries, the Forrest documentation output for
OpenOffice.org Writer files is what I was hoping for.
Web Maestro Clay
|