RE: [boost] Re: [Output Formatter]: Cascading Style Sheets (CSS)proposal

Pavel Vozenilek wrote:
"Reece Dunn" wrote:
Cascading Style Sheets (CSS) are a web standard [http://www.w3.org/Style/CSS/] used for controlling how HTML tags are displayed to different devices (screen, printer and speech).
It should be possible to provide the ability to save/load styling to/from a file and allow copying of style objects, e.g.: Wouldn't it be easier (for user) to specify template-like file (HTML + some marks) and the library would fill in marked areas with data?
The question is how to process this file to extract the default formatting information.
HTML-like templates would be easy to create and verify. The C++ code won't need to contain complex embedded CCS. Mistakes in template could be handled gracefully. Missing template could be handled too.
Sure. However, you would probably need a Spirit grammar to process it, adding a dependancy and making the code more complex.
When I want debug dump the last thing I need is playing with subtlety of another language.
If you want a debug dump, you can output the STL container directly: std::cout << "vector = " << vec << '\n'; The CSS stuff would only be relevant for the default formatting. Custom formatting works in pretty much the same way as described in the docs (with the name changes). The proposed CSS syntax behaves like Phoenix/Fusion in Boost.Spirit, using expression templates, e.g.: std::cout << css::element( "pair" ) [ css::attribute( "separator" ) = " = " ] << io::object( _pair ) << '\n'; so this isn't another language. I was using HTML+CSS as a model for implementing the styling here, showing how the concepts cross over. That said, getting this working would be developer investment, compile time, run-time and memory intensive, especially for more complex styling, whereas I already have a version up and running that allows you to control default styling for global decorators on a stream. Regards, Reece _________________________________________________________________ Want to block unwanted pop-ups? Download the free MSN Toolbar now! http://toolbar.msn.co.uk/

"Reece Dunn" wrote:
Wouldn't it be easier (for user) to specify template-like file (HTML + some marks) and the library would fill in marked areas with data?
Sure. However, you would probably need a Spirit grammar to process it, adding a dependancy and making the code more complex.
Yes but such tradeoff is positive to end user.
If you want a debug dump, you can output the STL container directly:
std::cout << "vector = " << vec << '\n';
One often needs dump of quite complex data structures. Controlling their visual appearance from C++ code feels as large burden. As the ideal solution I would imagine something what takes the dumped data and with using some heuristics arranges them into most readable form. User the could rearrange the data on HTML page (e.g. using Javascript) and this re-arrangement would be stored somewhere and used next time these data are shown. /Pavel
participants (2)
-
Pavel Vozenilek
-
Reece Dunn