You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Nicola Ken Barozzi <ni...@apache.org> on 2003/09/08 17:34:05 UTC

Adding @class attribute to all xdoc elements

To make it easy for users to add information and tweak the style 
accordingly using only CSS, without having to redo a DTD and skin and 
sitemap fix, we have to add @class attributes to all elements.

I therefore propose that we add a @class attribute in the "Common 
attributes" section of the DTD, and add user.css stylesheet.

Objections?
Comments?

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------



Re: Adding @class attribute to all xdoc elements

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Ramon Prades wrote:

> Hi Nicola
> 
> The problem with this attribute, as pointed before by Jeff Turner, is that
> "class "attribute will break content-presentation separation, since the
> forrest doc focuses on content but that attribute belongs to presentation.

Well, actually no. A class attribute defines the "class" to which a tag 
belings to. This does not mean that it has to be shown in a particular way.

The stylesheet shows the style, not the class attribute.

Example:

Imagine that we lacked a <note> tag. A user could do:

   <p class="note"></p>

This has nothing to do with presentation, just semantics. It's an easy 
way to augment semantics and keep style separate.

ATM users are using ehtml to do this, which does *not* enforce this 
separation, having style tags in the html.

> Having said that, I recognise there's a need for altering the way Forrest
> applies style to certain documents, but maybe there's a better solution.
> Perhaps a "meta" tag telling the user-defined type of document (as in
> "white-paper", "article", and so on), and then some extra config in
> "skinconf" binding an specific type to a different css or selector. This
> could also be used to alter the way Forrest generates the page.
> 
> For example:
> 
> -- skinconf.xml --
> <skinconfig>
>   <document-skin type="white-paper">
>     <display-abstract>false</display-abstract>
>     <display-toc>false</display-toc>
>     <style link="anyfile.css">
>       <title>myTitle</title>  <!-- this will use selector "myTitle" to
> display "title" tags -->
>       <p>font-family: Arial, Helvetica, sans-serif; font-size: 9px;color:
> #0033FF;</p> <!-- inline style -->
>     </style>
>   </document-skin>
> </skinconfig>
> 
> This is just an idea. 

I think this is a bit complicated. If the user just needs to change a 
CSS stylesheet to change presentation, isn't it easier and cleaner just 
to change that stylesheet?

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------



RE: Adding @class attribute to all xdoc elements

Posted by Ramon Prades <rp...@porcelanosa.com>.
Hi Nicola

The problem with this attribute, as pointed before by Jeff Turner, is that
"class "attribute will break content-presentation separation, since the
forrest doc focuses on content but that attribute belongs to presentation.

Having said that, I recognise there's a need for altering the way Forrest
applies style to certain documents, but maybe there's a better solution.
Perhaps a "meta" tag telling the user-defined type of document (as in
"white-paper", "article", and so on), and then some extra config in
"skinconf" binding an specific type to a different css or selector. This
could also be used to alter the way Forrest generates the page.

For example:

-- skinconf.xml --
<skinconfig>
  <document-skin type="white-paper">
    <display-abstract>false</display-abstract>
    <display-toc>false</display-toc>
    <style link="anyfile.css">
      <title>myTitle</title>  <!-- this will use selector "myTitle" to
display "title" tags -->
      <p>font-family: Arial, Helvetica, sans-serif; font-size: 9px;color:
#0033FF;</p> <!-- inline style -->
    </style>
  </document-skin>
</skinconfig>

This is just an idea. 

Regards.

Ramon

-----Mensaje original-----
De: news [mailto:news@sea.gmane.org] En nombre de Nicola Ken Barozzi
Enviado el: lunes, 08 de septiembre de 2003 17:34
Para: forrest-dev@xml.apache.org
Asunto: Adding @class attribute to all xdoc elements



To make it easy for users to add information and tweak the style 
accordingly using only CSS, without having to redo a DTD and skin and 
sitemap fix, we have to add @class attributes to all elements.

I therefore propose that we add a @class attribute in the "Common 
attributes" section of the DTD, and add user.css stylesheet.

Objections?
Comments?

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------