On Thursday 11 March 2004 05:31 pm, Reece Dunn wrote:
> I have had a brief look at the code and I think I understand what is going
> on. I would be happy to colaborate with Joel. Regarding the syntax
> highlighting, I have a few questions:
>
> [1] From what I can gather about the existing solution, it works at the
> BoostBook to DocBook stage: is it possible to move that to the DocBook to
> HTML stage, possibly via an intermediate (i.e. if highlighting is enabled,
> putting the block in a <highlight> tag or something). This would then allow
> me to do things like:
>
> <span class = "cpp-keyword">template</span>
> <span class = "cpp-comment">// comment</span>
>
> and then you could control the colour, etc via stylesheets. I would also
> make the highlight tag produce <div class = "highlight">...</div> or
> something so you could control font, etc via stylesheets as well.
FYI, I'm not really comfortable with hacking the DocBook->HTML stage unless
absolutely necessary. If we can do something at the BoostBook->DocBook stage
instead, we should, so that it can be picked up in the other transformations.
I know it won't work for everything (of course), but, e.g., we might be able
to leverage the role attribute of DocBook's emphasis element to pull some
tricks within standard DocBook.
> [2] Would it be more efficient to recursively split the text into smaller
> blocks until it reaches a certain size then process that? Here is an XSLT
> template that will split a string into space-seperated words:
>
[snip]
I haven't tried it this way, but I don't expect it would be much faster.
> And here is a driver template for it:
>
> <xsl:template match = "text()">
> <xsl:call-template name = "tokeniser">
> <xsl:with-param name = "s" select = "normalize-space(.)"/>
> </xsl:call-template>
> </xsl:template>
You surely don't want to normalize the spaces, do you? <programlisting>
environments are all about precise spacing.
> [3] Only keywords and comments are syntax highlighted. Are there any plans
> or is there interest in adding support for other tokens (symbols,
> identifiers, string constants, etc) or am I being over ambitious :)?
Only keywords are actually highlighted. Comments are written directly wrapped
in <emphasis> elements because we have enough semantic information to do so.
Real lexical analysis would be way too expensive in XSLT.
Doug
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Boost-docs mailing list
[EMAIL PROTECTED]
Unsubscribe and other administrative requests:
https://lists.sourceforge.net/lists/listinfo/boost-docs