Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Forrest: User

wiki monospace: minor bug?

 

 

Forrest user RSS feed   Index | Next | Previous | View Threaded


rinaldi at ifi

Aug 16, 2004, 8:47 AM

Post #1 of 3 (65 views)
Permalink
wiki monospace: minor bug?

Hi,

according to the documentation at:

http://forrest.apache.org/docs/wiki-sample.html

{{text}} = prints 'text' in monospaced font.

However, I could not get this to work. This specification seems to be
completely ignored: in the output I get the brackets and the text
without any special font effect.

Best,
Fabio


dave at brondsema

Aug 16, 2004, 9:03 AM

Post #2 of 3 (62 views)
Permalink
Re: wiki monospace: minor bug? [In reply to]

On Mon, 16 Aug 2004, Fabio Rinaldi wrote:

>
> Hi,
>
> according to the documentation at:
>
> http://forrest.apache.org/docs/wiki-sample.html
>
> {{text}} = prints 'text' in monospaced font.
>
> However, I could not get this to work. This specification seems to be
> completely ignored: in the output I get the brackets and the text
> without any special font effect.
>

You're right. The chaperon parser is used to parse the wiki files
(JSPWiki format) and nobody the transformations are not as complete as
JSPWiki itself. Definition lists are also not supported and whitespace
matters a lot more than in JSPWiki. If you'd like to try your hand at
adding support, these are the files in 0.6 (from SVN) to use:

src/core/context/resources/chaperon/grammars/wiki.grm
src/core/context/resources/chaperon/stylesheets/wiki2xdoc.xsl


--
Dave Brondsema : dave [at] brondsema
http://www.brondsema.net : personal
http://www.splike.com : programming
http://csx.calvin.edu : student org


rinaldi at ifi

Aug 18, 2004, 4:26 AM

Post #3 of 3 (61 views)
Permalink
Re: wiki monospace: minor bug? [In reply to]

Hi Dave,

thanks for pointing me to the files. Adding support for the
'monospaced' construction is pretty trivial, as this is already
defined in "wiki.grm". It is enough to add the following to
"wiki2xdoc.xsl":

271a272,275
> <xsl:template match="st:codeblock">
> <code><xsl:value-of select="st:text"/></code><xsl:text> </xsl:text>
> </xsl:template>
>

However, adding support for definition lists is far more complex as
this is not already defined in "wiki.grm" (at least, I could not spot
it). Besides, I do not see a great need for them.

There are other things that one might wish to have, for instance
something that I really miss is the possibility of defining a title
for a wiki page. As far as I can tell, currently the name of the file
is taken as the title of the page. This might not always be the
desired behaviour.

I have found a way to add support for this feature by modifying the
template for "st:output" in "wiki2xdoc.xsl" as follows:

<xsl:template match="st:output">
<document>
<header>
<title>
<xsl:variable name="title" select="st:document/st:section/st:title/st:textsequence"/>
<xsl:choose>
<xsl:when test="$title">
<xsl:value-of select="$title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="splitString">
<xsl:with-param name="restOfString" select="$name"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</title>
</header>
<body>
<xsl:apply-templates select="st:document/st:paragraphs/st:paragraph/*" mode="paragraph"/>
<xsl:apply-templates select="st:document/st:section"/>
</body>
</document>
</xsl:template>


With this change, if there is a top-level title (!!! TITLE ) at the
start of the wiki document, it will be taken as the title of the
page. If not, the name of the file will be used. Notice that I am
assuming (contrary to the original version), that the variable '$name'
is always passed to this template.

Let me know if this is useful.

Best,
Fabio

Dave Brondsema writes:
> On Mon, 16 Aug 2004, Fabio Rinaldi wrote:
>
> >
> > Hi,
> >
> > according to the documentation at:
> >
> > http://forrest.apache.org/docs/wiki-sample.html
> >
> > {{text}} = prints 'text' in monospaced font.
> >
> > However, I could not get this to work. This specification seems to be
> > completely ignored: in the output I get the brackets and the text
> > without any special font effect.
> >
>
> You're right. The chaperon parser is used to parse the wiki files
> (JSPWiki format) and nobody the transformations are not as complete as
> JSPWiki itself. Definition lists are also not supported and whitespace
> matters a lot more than in JSPWiki. If you'd like to try your hand at
> adding support, these are the files in 0.6 (from SVN) to use:
>
> src/core/context/resources/chaperon/grammars/wiki.grm
> src/core/context/resources/chaperon/stylesheets/wiki2xdoc.xsl
>

Forrest user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.