Boost logo

Boost :

From: Nicolai Josuttis (nicolai.josuttis_at_[hidden])
Date: 2000-01-06 07:43:08


Ed Brey wrote:
>
> Fortunately, in this case we aren't necessarily stuck with a single
> "religion". Enter cascading style sheets (CSS). For starters, instead of
> saying:
>
> <FONT FACE="Arial">// Some comment</FONT>
> you say:
> <SPAN CLASS="Comment">// Some comment</SPAN>
>
> and in the beginning of the file (or in another file), you say:
>
> .Comment {
> font-family: sans-serif;
> color: green;
> }

Hmmm, if I understood it correctly it has to be as follows (inside the HEAD
section):
 <STYLE type="text/css">
  SPAN.comment {
   ...
  }
 </STYLE>

>
> The neat part is that the user can specify a style sheet override (for IE5
> via Internet Options -> General -> Accessibility -> User style sheet). For
> example:
>
> .Comment {
> font-family: monospace;
> }
>
> This way there can be one boost default, but each user can customize if
> desired.
>
> One caveat about cascading style sheets: As much as we complain about
> compiler nonconformance of C++, it all pales in comparison to
> non-conformance of interpreting CSS, especially with Netscape. However, as
> long as we stick to the simple stuff, we should be OK.
>
INDEED, after having inserted style sheets I wondered why they didn't work
with Netscape. It turned out that they don't work if Java Script is disabled.
As this should be the default (for safety reasons), this means, style
sheets don't work by default yet under Netscape!!!
So, I stay with "hardcoded" font settings.

And, as I see no convinding argument and as I provide the awk script
I will stay with my policy as default:
 - source code in monospaced font
 - comment in propotional font
Note that comment is still aligned because up to the first comment letter
all is in monospaced font. So, the only alignment that don't work are
alignments inside comments (which should be very rare IMO).

> To take this one step further, it should be possible to use dynamic HTML to
> put a couple of buttons on the upper-right of the HTML page that quickly
> choose between common font combinations, but the details of this are beyond
> me and maybe not worth the effort. Of course, even better would be to use
> XML, but general browser support just isn't there yet.
>
Hmmm, how about a button to generate PDF and Word format? :-)
To be honest: Keep it simple, so I stay with a little but robust
script that works (almost) everywhere.

> I'm willing to help out with modifying the awk script if there is interest
> in using CSS.
>
I tried on my own, but thanks for the hint;
was my first experience with style sheets.

Best

-- 
Nicolai M. Josuttis          	http://www.josuttis.de/
Solutions in Time        	mailto:solutions_at_[hidden]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk