|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-04-26 18:04 UTC] danielc@php.net
Description:
------------
Here are suggestions on improving how fieldsynopsis elements are rendered inside description sections, per discussion on php-doc ("improving object oriented / procedural combinations", http://news.php.net/php.doc/969381741). The CSS changes are attached. The DocBook sources and proposed HTML output are entered below.
STATIC
------
DocBook:
<classsynopsis>
<ooclass><classname>foo</classname></ooclass>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>static</modifier>
<type>int</type>
<varname>bar</varname>
</fieldsynopsis>
</classsynopsis>
HTML:
<div class="refsect1 description">
<h3 class="title">Description</h3>
<p class="para">Object oriented style</p>
<div class="fieldsynopsis">
<span class="modifier">public</span>
<span class="modifier">static</span>
<span class="type">int</span>
<span class="classname">foo</span>::$<var class="varname">bar</var>
</div>
</div>
------------
OBJECT
------
DocBook:
<classsynopsis>
<ooclass><classname>foo</classname></ooclass>
<fieldsynopsis>
<modifier>public</modifier>
<type>int</type>
<varname>bar</varname>
</fieldsynopsis>
</classsynopsis>
HTML:
<div class="refsect1 description">
<h3 class="title">Description</h3>
<p class="para">Object oriented style</p>
<div class="fieldsynopsis">
<span class="modifier">public</span>
<span class="type">int</span>
$<span class="classname">foo</span>-><var class="varname">bar</var>
</div>
</div>
Patchesfieldsynopsis-site.css (last revision 2010-04-26 16:06 UTC by danielc@php.net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 01:00:01 2025 UTC |
Some OOP methodsynopsis in our existing DocBook sources are marked up inside classsynopsis, even though the standard is to just have them on their own. So, while you're doing the fieldsynopsis changes, it seems like a good idea to also adjust the rendering engine produce the same HTML either way. DOCBOOK WITH CLASSYNOPSIS ------------------------- <classsynopsis> <ooclass><classname>XMLWriter</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>openURI</methodname> <methodparam><type>string</type><parameter>uri</parameter></methodparam> </methodsynopsis> </classsynopsis> STANDARD DOCBOOK ---------------- <methodsynopsis> <type>bool</type><methodname>XMLWriter::openURI</methodname> <methodparam><type>string</type><parameter>uri</parameter></methodparam> </methodsynopsis> SHOULD BOTH PRODUCE THE FOLLOWING HTML -------------------------------------- <div class="methodsynopsis dc-description"> <span class="methodname"><b>XMLWriter::openURI</b></span>() </div>Sorry to use this bug report as a way of working through this issue... It seems like a good idea to have properties marked up the same way we mark up methods -- put the class name in the method/field element. This is better because it is consistent and shorter. So the changes should also allow the following markup to produce the same HTML output as discussed above. DOCBOOK FOR OBJECT ------------------ <fieldsynopsis> <modifier>public</modifier> <type>int</type> <varname>$foo->bar</varname> </fieldsynopsis> DOCBOOK FOR STATIC ------------------ <fieldsynopsis> <modifier>public</modifier> <modifier>static</modifier> <type>int</type> <varname>foo::$bar</varname> </fieldsynopsis>