Re: svn: /phd/trunk/phpdotnet/phd/Package/PEAR/ CHM.php
| From: | Hannes Magnusson | Date: | Sat, 12 Sep 2009 19:05:22 +0000 |
| Subject: | Re: svn: /phd/trunk/phpdotnet/phd/Package/PEAR/ CHM.php | ||
| References: | 1 | Groups: | php.doc.cvs |
| Request: | Send a blank email to doc-cvs+get-4911@lists.php.net to get a copy of this message | ||
This commit has a lot of other things then needed for making title
attributes for links.
Are you sure everything is valid? Even the 'tr' entry and all?
Please update the package.xml <notes> entry with your changes/fixes.
-Hannes
On Fri, Sep 11, 2009 at 15:53, Richard Quadling <rquadling@php.net> wrote:
> rquadling Fri, 11 Sep 2009 13:53:14 +0000
>
> Revision:
> http://svn.php.net/viewvc?view=revision&revision=288269
>
> Log:
> Add title attribute to external links so address can be seen in CHM
>
> Changed paths:
> U phd/trunk/phpdotnet/phd/Package/PEAR/CHM.php
>
> Modified: phd/trunk/phpdotnet/phd/Package/PEAR/CHM.php
> ===================================================================
> --- phd/trunk/phpdotnet/phd/Package/PEAR/CHM.php 2009-09-11 13:50:48 UTC (rev
> 288268)
> +++ phd/trunk/phpdotnet/phd/Package/PEAR/CHM.php 2009-09-11 13:53:14 UTC (rev
> 288269)
> @@ -163,6 +163,12 @@
> "mime_charset_name"
> => "Windows-1252",
> "preferred_font" =>
> self::DEFAULT_FONT
> ),
> + "tr" => array(
> + "langcode" =>
> "0x41f Turkish",
> + "preferred_charset"
> => "Windows-1254",
> + "mime_charset_name"
> => "Windows-1254",
> + "preferred_font"
> => self::DEFAULT_FONT
> + ),
> "zh" => array(
> "langcode" =>
> "0x804 Simplified Chinese",
> "preferred_charset"
> => "CP936",
> @@ -245,7 +251,7 @@
> fwrite($this->hhkStream, "
> <li><object type=\"text/sitemap\">\n" .
> " <param
> name=\"Local\" value=\"{$ref}\">\n" .
> " <param
> name=\"Name\" value=\"" . htmlentities(self::cleanIndexName($name, ENT_COMPAT,
> "UTF-8")) . "\">\n" .
> - " </object>\n
> </li>\n");
> + " </object>\n");
> } elseif ($this->flags & Render::CLOSE) {
> if ($hasChild) {
> fwrite($this->hhcStream,
> "{$this->offset(2)}</ul>\n");
> @@ -274,20 +280,22 @@
> protected function headerChm() {
> $lang = Config::language();
> fwrite($this->hhpStream, '[OPTIONS]
> +Binary TOC=Yes
> Compatibility=1.1 or later
> Compiled file=pear_manual_' . $lang . '.chm
> Contents file=pear_manual_' . $lang . '.hhc
> -Index file=pear_manual_' . $lang . '.hhk
> +Default Font=' . ($this->LANGUAGES[$lang]["preferred_font"] ?
> $this->LANGUAGES[$lang]["preferred_font"] : self::DEFAULT_FONT). '
> +Default topic=res\index.html
> Default Window=doc
> -Default topic=res\index.html
> Display compile progress=Yes
> +Enhanced decompilation=Yes
> Full-text search=Yes
> +Index file=pear_manual_' . $lang . '.hhk
> Language=' . $this->LANGUAGES[$lang]["langcode"] . '
> -Title=' . ($this->LANGUAGES[$lang]["title"] ?
> $this->LANGUAGES[$lang]["title"] : self::DEFAULT_TITLE) . '
> -Default Font=' . ($this->LANGUAGES[$lang]["preferred_font"] ?
> $this->LANGUAGES[$lang]["preferred_font"] : self::DEFAULT_FONT). '
> +Title=' . (isset($this->LANGUAGES[$lang]["title"]) ?
> $this->LANGUAGES[$lang]["title"] : self::DEFAULT_TITLE) . '
>
> [WINDOWS]
> -doc="' . ($this->LANGUAGES[$lang]["title"] ?
> $this->LANGUAGES[$lang]["title"] : self::DEFAULT_TITLE) .
> '","pear_manual_' . $lang . '.hhc","pear_manual_' . $lang .
> '.hhk","res\index.html","res\index.html",,,,,0x23520,,0x386e,,,,,,,,0
> +doc="' . (isset($this->LANGUAGES[$lang]["title"]) ?
> $this->LANGUAGES[$lang]["title"] : self::DEFAULT_TITLE) .
> '","pear_manual_' . $lang . '.hhc","pear_manual_' . $lang .
> '.hhk","res\index.html","res\index.html",,,,,0x33520,,0x70386e,,,,,,,,0
>
> [FILES]
> res\reset-fonts.css
> @@ -402,6 +410,14 @@
> return $spaces;
> }
>
> + public function format_link($open, $name, $attrs, $props) {
> + $link = parent::format_link($open, $name, $attrs, $props);
> + // Add title attribute to external links so address can be seen in CHM files.
> + $search = '
<a href="([^#"][^"]++)"
> class="link external">';
> + $replacement = '<a href="\1" class="link external"
> title="Link : \1">';
> + $link = preg_replace($search, $replacement, $link);
> + return $link;
> + }
> }
>
> /*
>
>
> --
> PHP Documentation Commits Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>