-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
today I was looking into the docbook source of the agavi manual (I'm
trying to write down what I pieced together about validation) and
found something which I though was quite interesting. As the docbook-
format is XML it won't accept examples which contain xml/html tags or
entities, so the person(s) writing the docs is/are going to great
length escaping them properly:
<programlisting>/* Loads /app/modules/Dogs/models/Dog
[Model].class.php and initializes it with a name and a breed. */
$myDog = $this->getContext()->getModel('Dog', 'Dogs', array
('name'=>'Nelli', 'breed'=>'Novascotian retriever'));
/* class SinglesBar implements AgaviISingletonModel */
$bar1 = $this->getContext()->getModel('SinglesBar'); //loads
and initializes the model.
$bar2 = $this->getContext()->getModel('SinglesBar'); //returns
the same instance of SinglesBar as the line above.</programlisting>
However, this is way too much work, especially in the examples about
the xml configuration files. There is an easier way: just wrap a <!
[CDATA[ ]]> marker around the example and no tags/entities will be
parsed or interpreted.
<programlisting><![CDATA[/* Loads /app/modules/Dogs/models/Dog
[Model].class.php and initializes it with a name and a breed. */
$myDog = $this->getContext()->getModel('Dog', 'Dogs', array
('name'=>'Nelli', 'breed'=>'Novascotian retriever'));
/* class SinglesBar implements AgaviISingletonModel */
$bar1 = $this->getContext()->getModel('SinglesBar'); //loads and
initializes the model.
$bar2 = $this->getContext()->getModel('SinglesBar'); //returns the
same instance of SinglesBar as the line above.]]></programlisting>
Less typing, easier to read in the source. If you were aware of this
already and have a compelling reason to do otherwise please tell me
so that I can adapt the parts I'm writing accordingly.
One other note: The stylesheet makes for an unreadable small default
fontsize on ff/safari on OSX.
regards
felix
- --
If it ain't broken, fix it 'till it is.
(usenet quote)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
iD8DBQFFv9XSGLZ/2ixjPUARAmTKAJ4tPjD7kxtM5rz/wuOjIPYsMyVfzwCgrI7j
YL0sPziV6j5ZpiMjN2GX6mk=
=P96T
-----END PGP SIGNATURE-----
_______________________________________________
Agavi Dev Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/dev