Jo�o Abecasis <[EMAIL PROTECTED]> writes:
> John Maddock wrote:
>> Quick question: how do I "turn off" syntax highlighting, and "turn
>> on" my own syntax for a short code snippet, contained within a
>> larger code chunk, for example I have:
>> template <class T>
>> struct is_void : public true-or-false-type {};
>> And I would like the "true-or-false-type" bit to be in italic, and
>> otherwise not highlighted. However the usual mark-up with /text/ or
>> ['text] fails to work. This is quite a common requirement for
>> things that are "unspecified", "implementation defined", or
>> named-concepts etc, can it be done?
>
> Thomas Guest was working on dynamically loadable syntax highlighters.
> His work provides the ability to write customized syntax highlighters
> and would help you here.
I don't believe that is the appropriate approach for John's problem.
He needs a convenient way to insert the <replaceable> </replaceable>
tag in the generated XML. This is formatted as italic by BoostBook
and represents the right semantics to boot.
Replaceable text in code is an important idiom that we used often in
"C++ Template Metaprogramming," and has crucial interactions with the
literate programming/testing system we used to test the examples: you
need to replace the <replaceable> text with something concrete in
order to make the tests work. Of course, ReST doesn't have
<replaceable>, so we just used italics and interpreted all italics in
literal blocks as <replaceable>. ReST has a parsed-literal directive
within which markup is significant, so it was pretty easy:
.. parsed-literal::
template <class T>
struct is_void : public *true-or-false-type* {};
QuickBook needs something similar.
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Boost-docs mailing list
[email protected]
Unsubscribe and other administrative requests:
https://lists.sourceforge.net/lists/listinfo/boost-docs