Subject: Re: [boost] How to center an element in Boost QuickBook?
From: Niall Douglas (ndouglas_at_[hidden])
Date: 2013-08-08 10:55:22


> > The key here is the [role styleclass text] modifier: this just happens
> > to spit out <span class="styleclass">text</span>. By adding suitable
> > extra CSS to the main CSS file, one can make
> coloured
> > text, or in my case, turn a span into a display:inline-block; and
> > therefore can do
> text-align:center.
> >
> > I hope this is useful to someone someday. If [role] will continue to
> > always do this, and it's not
> just by
> > accident, it might be worth adding to the Quickbook FAQ. That said, a
> > proper formally specified typesetting mechanism would be a lot better
again.
>
> Whoops of delight!
>
> Please can we have this in Quickbook asap.
>
> Please can you provide the extra CSS and the cross and tick templates -
> commonly useful to go in the Quickbook toolkit.

Sure. Proposed Boost.AFIO is technically fully ported to Boost now, so
you'll find its QuickBook sources at:

https://github.com/BoostGSoC/boost.afio/tree/master/libs/afio/doc

For coloured ticks and crosses:

https://github.com/BoostGSoC/boost.afio/blob/master/libs/afio/doc/afio.qbk
contains the Quickbook macros:

[def __tick__ [role aligncenter [role green \u2714]]]
[def __cross__ [role aligncenter [role red \u2718]]]

The requisite CSS can be found appended to the bottom of this boostbook.css
at
https://github.com/BoostGSoC/boost.afio/blob/master/libs/afio/doc/html/myboo
stbook.css#L660.

You'll note I did some funky CSS things with getting the BoostBook TOC to go
multi-column which has generated (what I consider to be) a most pleasing
compact TOC layout which can be seen at
https://ci.nedprod.com/job/Boost.AFIO%20Build%20Documentation/Boost.AFIO_Doc
umentation/doc/html/index.html.

Niall

---
Opinions expressed here are my own and do not necessarily represent those of
BlackBerry Inc.