Re: [Boost-docs] How to get syntax coloring in Quickboook Doxygen C++ Reference sections

Subject: Re: [Boost-docs] How to get syntax coloring in Quickboook Doxygen C++ Reference sections
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2013-10-28 18:43:15


> -----Original Message-----
> From: Boost-docs [mailto:boost-docs-bounces_at_[hidden]] On Behalf Of Daniel James
> Sent: Sunday, October 27, 2013 6:12 PM
> To: Discussion of Boost Documentation
> Subject: Re: [Boost-docs] How to get syntax coloring in Quickboook Doxygen C++ Reference sections
>
> On 27 October 2013 17:54, Paul A. Bristow <pbristow_at_[hidden]> wrote:
> > I'm haven't another déjà vu about this issue ;-)
> >
> > But is there something I am doing wrong that I am not seeing syntax
> > coloring from this Doxygen comment, even after specifying that it is cpp.
> >
> > (Syntax coloring works fine from Quickbook snippets).
> >
> > @b Example:
> >
> > \code{.cpp}
> > #include <boost/numeric/safe_cast.hpp> #include
> > <boost/numeric/safe_integer.hpp>
> >
> > void f(){
> > safe_integer<char> i;
> > unsigned char j;
> > i = 1;
> > j = safe_cast<unsigned char>(i); // ok
> > i = -1;
> > j = safe_cast<unsigned char>(i); // throws std::out_of_range exception
> > i = 1024;
> > j = safe_cast<unsigned char>(i); // throws std::out_of_range
> > exception } \endcode
> >
> > This gives syntax colored if you use the doxywizard, but the html
> > generated from Quickbook toolchain is just in 'code font' with the
> > html source
>
> Where are you putting this code sample? I tried adding it to a class description and it was syntax
> highlighted there. Syntax highlighting for doxygen documentation is handled in the boostbook to
> docbook stage, and I guess it only does it in certain places. It might be possible to add it where
you need
> it.

I put it with a function. I've checked that it works OK as a class example as Daniel reported.

I've glanced at doxygen2boostbook.xsl but how to make it work for functions as well as classes
didn't jump out at me ;-)

(I can see uses for all types - even MACROs?)

Hints?

Thanks to all.

Paul


This archive was generated by hypermail 2.1.7 : 2017-11-11 08:50:41 UTC