cvs: peardoc /en/package/html html-css.xml /en/package/html/html-css find.xml
| From: | Laurent Laville | Date: | Thu, 22 Jan 2009 10:57:44 +0000 |
| Subject: | cvs: peardoc /en/package/html html-css.xml /en/package/html/html-css find.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-11463@lists.php.net to get a copy of this message | ||
farell Thu Jan 22 10:57:44 2009 UTC
Added files:
/peardoc/en/package/html/html-css find.xml
Modified files:
/peardoc/en/package/html html-css.xml
Log:
phase6: continue to include my external doc (TDG) => Getting Started -> Find definitions
http://cvs.php.net/viewvc.cgi/peardoc/en/package/html/html-css.xml?r1=1.19&r2=1.20&diff_format=u
Index: peardoc/en/package/html/html-css.xml
diff -u peardoc/en/package/html/html-css.xml:1.19 peardoc/en/package/html/html-css.xml:1.20
--- peardoc/en/package/html/html-css.xml:1.19 Thu Jan 22 10:48:51 2009
+++ peardoc/en/package/html/html-css.xml Thu Jan 22 10:57:40 2009
@@ -124,6 +124,7 @@
&package.html.html-css.group;
&package.html.html-css.parse;
&package.html.html-css.output;
+ &package.html.html-css.find;
</chapter>
<chapter xml:id="package.html.html-css.ref">
http://cvs.php.net/viewvc.cgi/peardoc/en/package/html/html-css/find.xml?view=markup&rev=1.1
Index: peardoc/en/package/html/html-css/find.xml
+++ peardoc/en/package/html/html-css/find.xml
<?xml version="1.0" encoding="utf-8"?>
<refentry xmlns="http://docbook.org/ns/docbook"
version="lillet" xml:id="package.html.html-css.find">
<refnamediv>
<refname>Find definitions</refname>
<refpurpose>searching for selectors and properties</refpurpose>
</refnamediv>
<refsection xml:id="package.html.html-css.find.purpose">
<info><title>In brief</title></info>
<para>
One of features of HTML_CSS that was still missing to version less or equal
than 1.0.1 is ability to detect if a selector (or group of selectors), and/or
a property (or group of properties) was already defined.
This is now possible with method :
<methodname>HTML_CSS::grepStyle()</methodname>
</para>
</refsection>
<refsection xml:id="package.html.html-css.find.selectors">
<info><title>Searching for a group of selectors</title></info>
<para>
Let creates these definitions into <filename>progress2.css</filename> file :
<programlisting role="css">
#PB1.cellPB1I, #PB1.cellPB1A {
width: 15px;
height: 20px;
font-family: Courier, Verdana;
font-size: 8px;
float: left;
}
#PB1.progressBorderPB1 {
width: 172px;
height: 24px;
border-width: 1px;
border-style: solid;
border-color: #404040 #dfdfdf #dfdfdf #404040;
background-color: #CCCCCC;
}
.progressPercentLabelpct1PB1 {
width: 50px;
text-align: right;
background-color: transparent;
font-size: 11px;
font-family: Verdana, Tahoma, Arial;
font-weight: normal;
color: #000000;
}
.progressTextLabeltxt1PB1 {
text-align: left;
background-color: transparent;
font-size: 11px;
font-family: Verdana, Tahoma, Arial;
font-weight: normal;
color: #000000;
}
.cellPB1I {
background-color: #CCCCCC;
}
.cellPB1A {
background-color: #0033FF;
}
body {
background-color: #E0E0E0;
color: #000000;
font-family: Verdana, Arial;
}
</programlisting>
</para>
<para>
Very easy with such script to find where is declared <literal>#PB1</literal>
class selectors (names like).
<programlisting role="php">
<![CDATA[
<?php
require_once 'HTML/CSS.php';
$css = new HTML_CSS();
$css->parseFile('progress2.css');
// find all selectors beginning with #PB1
$styles = $css->grepStyle('/^#PB1/');
echo '<pre>'; var_dump($styles); echo '</pre>';
?>
]]>
</programlisting>
</para>
</refsection>
<refsection xml:id="package.html.html-css.find.properties">
<info><title>Searching for selectors that set a property</title></info>
<para>
We still used the CSS definitions of previous example,
identified by <filename>progress2.css</filename> file :
</para>
<para>
Very easy with such script to find where is declared <literal>color</literal>
property.
<programlisting role="php">
<![CDATA[
<?php
require_once 'HTML/CSS.php';
$css = new HTML_CSS();
$css->parseFile('progress2.css');
// find all selectors that set the color property
$styles = $css->grepStyle('/./', '/^color$/');
echo '<pre>'; var_dump($styles); echo '</pre>';
?>
]]>
</programlisting>
</para>
</refsection>
</refentry>