This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What's the most appropriate (and futureproof) way tostyle the FO?


Hi

Bob Stayton wrote:

Norm might want to answer this too, but
I believe the mechanisms are meant to be combined, in
a hierarchical manner.  The titlepage.templates
mechanism establishes the default values, and the
propery attribute-sets provide the runtime flexibility.

But some stuff can only be set in the titlepage AFAICS.


As you know,

I did not know that.

editing a copy of titlepage.templates.xml
and regenerating titlepage.templates.xsl is not something
you want to do very often.

It needs to be done each time I want to change more than one style property for which there is no option param or option param attribute set.

Again: Styling is the most basic customization, and it should be as painless and as lightweight as possible IMHO.

When I generate XHTML, I get the basic styling from the base/default CSS of the browser (actually I'm using my own, but that's optional); then I can add styling and override the defaults in a very flexible, simple, quick, and painless way, by inserting any number of stylesheets in the cascade, below the base style. That's how I'd like to do it with the FO XSLTs. Not so much redundancy and different places and mechanisms, editing my own small files not the provided one, subset / override only the relevant parts instead of copying the whole 1KLOC shebang (in the case of the FO titlepage), etc.

It can be used to set
properties, but think of them as the new default properites.

This would only be possible if I could override all of them in some other way or file, which is not possible AFAICS. I have to deal with the titlepage mechanism for many stylings, so it makes no difference if they are called "new defaults" or not.


It is important to retain the ability to change properties
at run time, using parameters and attribute-sets.

Sounds good; but since this is not possible for all properties, the more static nature of the titlepage mechanism seems to have the problem you describe: it is not flexible and dynamic enough.


Since the attribute-set properties appear in an fo:block
nested inside the fo:block from the titlepage template,
it can override the defaults.

Can all properties set in the titlepage be overridden? This seems to be a requirement for all this to work out well.


Here is where the properties come from in your first example
above:

1. From attribute-set 'section.titlepage.recto.style' in
fo/titlepage.xsl:

<fo:block
keep-together="always"

2. From titlepage.templates.xml:

margin-left="-4pc"
font-family="sans-serif">

3. From <xsl:template match="section/title|..." mode="titlepage.mode">
in fo/sections.xsl:

<fo:block keep-with-next.within-column="always">

4. From attribute-set 'section.title.properties' in fo/param.xsl:

<fo:block font-family="sans-serif" font-weight="bold"
keep-with-next.within-column="always" space-before.minimum="0.8em"
space-before.optimum="1.0em" space-before.maximum="1.2em">
5. From attribute-set 'section.title.level1.properties' in
fo/param.xsl (not included in your example):

<fo:block font-size="20.736pt">

Thank you very much for taking the time to explain this.

But doesn't the length of this explanation show that styling FO currently is quite complex, inflexible, confusing, and very tedious?

Again: Your FO XSLTs sure are very useful already, but I see alot of room for improvement where the life of the user (who is styling and customizing output) can be made much easier.


In your case, you can make the change to font-weight=100
without regenerating titlepage.templates.xsl.  The
attribute-set 'section.title.properties' in fo/param.xsl
sets properties for all section title levels, while
'section.title.level1.properties' adds properties specific
to sect1 level headings.  Change the font-weight
in 'section.title.properties' from 'bold' to '100', and it will
apply to all section title levels.

Yes, but there were stylings where I was told that the only only way to achieve them is to edit (my copy of the) titlepage.


I can't say how 'futureproof" these various mechanisms are.
It kind of seems like there are too many places
to set properties,

Absolutely.

but I believe some of that is the result of
stylesheet evolution, rather than by design.

Probably.


So perhaps these will be consolidated a bit in the future.

Consolidation would be one of many measures and strategies which would improve the styling experience.

With all my (hopefully constructive) criticism I don't want to make your life harder, but instead make those of the users (including me) easier :)

Tobi

--
http://www.pinkjuice.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]