Re: working on PhD_PEAR, have questions about PhD / PhD_Generic
| From: | Hannes Magnusson | Date: | Mon, 06 Feb 2012 09:28:55 +0000 |
| Subject: | Re: working on PhD_PEAR, have questions about PhD / PhD_Generic | ||
| References: | 1 2 3 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969383618@lists.php.net to get a copy of this message | ||
On Sun, Feb 5, 2012 at 11:55, Alexey Borzov <borz_off@cs.msu.su> wrote:
> Hi Hannes,
>
>
> On 05.02.2012 14:09, Hannes Magnusson wrote:
>>>
>>> I'm currently trying to make HTML generated by PhD_PEAR conform to HTML5
>>> spec and fix a few more annoying problems with it.
>>>
>>> Most of the HTML-generating code, however, lives in PhD or Phd_Generic
>>> packages. Of course I can override that code in PhD_PEAR, but a cleaner
>>> solution will be to change it right there. Specifically, I am speaking
>>> about
>>> * Using presentational tags like<b>,<i>,<tt> in
>>> Package_Generic_XHTML.
>>> These can be trivially changed to<strong>,<em>,<code>.
>>> * Package_Generic_XHTML insists on adding align="left" to all<td>
>>> tags
>>> not
>>> having an explicit align attribute and valign="middle" tag to all<tr>
>>> tags
>>> not having an explicit valign attribute, see e.g. source of the doc page
>>> here [1]. Is there some reasoning behind this or can this be removed?
>>> * Table-related attributes (where they are actually needed) should be
>>> converted to CSS styles.
>>>
>>> So the question is: can I change the relevant parts in PhD / PhD_Generic?
>>> I
>>> don't see any bad consequences, but I may be missing something.
>>
>>
>> You need to be very careful when you changed the generated html, even
>> from<b> to<strong> as there could be lots of CSS specifically
>> targeting these elements.
>> In theory it shouldn't be an issue, but its something that needs to be
>> reviewed before a release at least.
>
>
> OK, I'll review the CSS on php.net. This shouldn't be difficult since there
> are only a few places with presentational tags.
>
>
>> Also, when moving inline presentation elements out to a css can be a
>> tricky thing, as we don't automatically link to a stylesheet in the
>> generation.
>
>
> Sorry, I was unclear here, I meant doing inline styles, e.g.
>
> align="right" -> style="text-align: right"
Ah, right, thats fine.
> Speaking of linking to stylesheets, what is the proper way to do it? I see
> that Package_Generic_XHTML::fetchStylesheet() calls Config::css(). If not
> passed a -C option on command line it will return an empty array, where is
> the proper place to inject the list of stylesheets to Config --- in a
> constructor of Format subclass?
Sure, if you want to "hardcode" an stylesheet for a package, you may
want to add it in the ctor.
Keep in mind, you would want to inline that css file in a bightml generation.
-Hannes