Hi!
I'm about to commit a couple of tweaks to quickbook's syntax
highlighting markup. These are mostly related to structure, the changes
should be transparent wrt to the final presented output.
Currently, the code snippet
int counter;
comes out from quickbook as,
<programlisting>
<literal>
<phrase role="keyword">int</phrase><phrase role="identifier">
counter</phrase><phrase role="special">;</phrase>
</literal>
</programlisting>
There are two things I dislike in this output,
1) the use of <literal> -- looking at DocBook specs, its use seems
to be illegal (actually, it is <phrase> that should not appear inside
<literal>), and removing it brings no change to the final output. From
reading DocBook's docs, it seems to me that the intent of literal is
sufficiently conveyed by programlisting. (DocBook reference can be found
here, <http://docbook.org/tdg/en/html/docbook.html>)
2) Whitespace shows up inside the highlighting markup as part of
the identifier/keyword/... Clearly whitespace should be outside the
markup. My recent tweak to BoostBook's whitespace stripping inside
<programlisting> ensures whitespace won't be lost. As a side effect of
changing this behaviour in the highlighter grammars, this reduces their
complexity just a tiny bit! I've measured 8% reduction in compile time
and object file size, after refactoring space_p. Runtime should also
benefit, but I haven't measured how many milliseconds we'll gain ;-)
A third issue (not illustrated above) is that under certain
circumstances, quickbook substitutes spaces with (non-breaking
spaces). The thing is, it doesn't do this consistently everywhere inside
the code snippet. I'd like to change this behaviour so that quickbook
never outputs the instead it should simply let whitespace fall
through as it is.
As mentioned at the begining, my changes affect the generated xml
structure but should not alter the final presentation of the docs.
Otherwise it's a bug.
I've got the patches ready to roll. Unless there are serious objections,
I was planning to commit them soon.
Regards,
João
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Boost-docs mailing list
[email protected]
Unsubscribe and other administrative requests:
https://lists.sourceforge.net/lists/listinfo/boost-docs