<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.simply-life.net/cheetah"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>ChEeTaH&#039;s - Qt</title>
 <link>http://www.simply-life.net/cheetah/taxonomy/term/46/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>Drupal Development made easier with Qt Assistant - Part 3a</title>
 <link>http://www.simply-life.net/cheetah/blog/2010-07-27/drupal-development-made-easier-qt-assistant-part-3a</link>
 <description>&lt;p&gt;Welcome back! It&#039;s been a while since I posted parts &lt;a href=&quot;http://www.simply-life.net/cheetah/blog/2009-11-10/drupal-development-made-easier-qt-assistant-part-1&quot;&gt;one&lt;/a&gt; and &lt;a href=&quot;http://www.simply-life.net/cheetah/blog/2009-11-22/drupal-development-made-easier-qt-assistant-part-2&quot;&gt;two&lt;/a&gt; of this series (yeah, I should blog more often...). Remember I was making Drupal documentation available in the Qt Assistant, a useful documentation viewer? Nice. I have some good news: I have spent some time again to get the documentation in decent order. So, without furder ado, let&#039;s continue!&lt;/p&gt;
&lt;h4&gt;Plan for today&lt;/h4&gt;
&lt;p&gt;In &lt;a href=&quot;http://www.simply-life.net/cheetah/blog/2009-11-10/drupal-development-made-easier-qt-assistant-part-1&quot;&gt;part one&lt;/a&gt; we prepared our system and got the necessary tools ready to begin our work. In &lt;a href=&quot;http://www.simply-life.net/cheetah/blog/2009-11-22/drupal-development-made-easier-qt-assistant-part-2&quot;&gt;part two&lt;/a&gt; we actually got our Drupal documentation working in the Qt Assistant, although there were several problems in the layout, as you may have noticed.&lt;/p&gt;
&lt;p&gt;After catching up with the changes in Drupal documentation since last time, today we will take a deeper look at some of the (Drupal specific) problems in the generated documentation. This includes getting back some text that is lost in the Doxygen process, by preprocessing the code that goes into Doxygen. This is subpart A, soon we&#039;ll also get the in-depth topics (e.g. the Forms API reference) working as well, in part 3B.&lt;/p&gt;
&lt;h4&gt;Changes since last time&lt;/h4&gt;
&lt;p&gt;Since the last time, there have been a few changes in the resources we used. Although I am now using a different Linux distribution, it seems that the Doxygen templates got a bit of a make-over: your documentation will look even better with the latest version. Everything looks a bit more modern now, which is good. You may want to update your software (Doxygen and Qt) to the latest versions if you haven&#039;t already done so, just for the sake of it.&lt;/p&gt;
&lt;p&gt;A more important change, however, is that the Drupal Developer Documentation on CVS no longer includes examples. Instead, the examples have now moved to their &lt;a href=&quot;http://drupal.org/project/examples&quot;&gt;own project&lt;/a&gt;. You can grab a snapshot of the appropriate version and extract it to your &lt;em&gt;developer&lt;/em&gt; subdirectory, which contains the Drupal Developer Documentation. Another useful option is to also grab this from CVS (see &quot;&lt;em&gt;&lt;a href=&quot;http://drupal.org/node/321&quot;&gt;Checking out from the contributions repository&lt;/a&gt;&lt;/em&gt;&quot; for detailed instructions):&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;cvs&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-z6&lt;/span&gt; -d:pserver:anonymous:anonymous&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;@&lt;/span&gt;cvs.drupal.org:&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;cvs&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;drupal-contrib checkout &lt;span style=&quot;color: #660033;&quot;&gt;-d&lt;/span&gt; developer&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;examples contributions&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;modules&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;examples&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Don&#039;t forget to update your developer documentation to the latest version as well. Especially if you&#039;re using Drupal 6, you may want to switch to the appropriate branch as follows (from the Drupal base directory, replace &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;-r DRUPAL-6--1&lt;/code&gt;&lt;/span&gt; with &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;-A&lt;/code&gt;&lt;/span&gt; for the latest HEAD version):&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;cvs&lt;/span&gt; -d:pserver:anonymous:anonymous&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;@&lt;/span&gt;cvs.drupal.org:&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;cvs&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;drupal-contrib update &lt;span style=&quot;color: #660033;&quot;&gt;-d&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-P&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-r&lt;/span&gt; DRUPAL-&lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt;--&lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; developer&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Just for completeness&#039; sake, if you want to do a clean checkout of all this developer documentation, enter the following two commands:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;cvs&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-z6&lt;/span&gt; -d:pserver:anonymous:anonymous&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;@&lt;/span&gt;cvs.drupal.org:&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;cvs&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;drupal-contrib checkout &lt;span style=&quot;color: #660033;&quot;&gt;-r&lt;/span&gt; DRUPAL-&lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt;--&lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-d&lt;/span&gt; developer contributions&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;docs&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;developer
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;cvs&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-z6&lt;/span&gt; -d:pserver:anonymous:anonymous&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;@&lt;/span&gt;cvs.drupal.org:&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;cvs&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;drupal-contrib checkout &lt;span style=&quot;color: #660033;&quot;&gt;-r&lt;/span&gt; DRUPAL-&lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt;--&lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-d&lt;/span&gt; developer&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;examples contributions&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;modules&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;examples&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;All done? Good, we&#039;re ready to move on again...&lt;/p&gt;
&lt;h4&gt;Noticed some problems?&lt;/h4&gt;
&lt;p&gt;If you used the documentation we created last time, you may have noticed some odd problems. We&#039;ll skip the broken links on the main page for now. First we deal with missing text. Look at the documentation of the &lt;a href=&quot;http://api.drupal.org/api/function/t&quot;&gt;t()&lt;/a&gt; function (in &lt;em&gt;includes/common.inc&lt;/em&gt;). You can see what&#039;s wrong in the screenshot as well:&lt;/p&gt;
&lt;div class=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/brokendoc1.png&quot; title=&quot;Broken Documentation&quot; rel=&quot;lightshow[fixingdoc]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/brokendoc1.png&quot; alt=&quot;Broken Documentation&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Notice how the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;@variable&lt;/code&gt;&lt;/span&gt; is missing in the second bullet, and the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;%&lt;/code&gt;&lt;/span&gt; character in front of &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;variable&lt;/code&gt;&lt;/span&gt; in the third bullet? A closer look at the Doxygen error output will tell us that it doesn&#039;t know the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;@variable&lt;/code&gt;&lt;/span&gt; command. &lt;a href=&quot;http://www.stack.nl/~dimitri/doxygen/commands.html&quot;&gt;Doxygen commands&lt;/a&gt; are prefixed with a &#039;@&#039; or &#039;\&#039; in Doxygen, but the code Drupal API module (which is used to run &lt;a href=&quot;http://api.drupal.org&quot;&gt;api.drupal.org&lt;/a&gt;) happily ignores any commands it doesn&#039;t know. Doxygen doesn&#039;t, which causes an issue here. With the &#039;%&#039; character, we tell Doxygen that we do not want the word &#039;variable&#039; to be auto-linked. But again, the Drupal API module doesn&#039;t seem to use that and simply prints it out.&lt;/p&gt;
&lt;p&gt;We will take a few steps to solve these problems. Part one: time for some PHP &lt;a href=&quot;http://www.php.net/manual/en/book.pcre.php&quot;&gt;Regular Expressions&lt;/a&gt; magic!&lt;/p&gt;
&lt;h4&gt;A basic preprocessor&lt;/h4&gt;
&lt;p&gt;Create a new plain text file with a nice name such as &lt;em&gt;perprocess-drupal-doxygen.php&lt;/em&gt;. This tells us exactly what it does: preprocess Drupal files for Doxygen; and it&#039;s a PHP script. Let&#039;s set up a quick base class first by pasting the following code in the file:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;php geshifilter-php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;#!/usr/bin/php&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;abstract &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; Preprocessor &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$_filename&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; __construct &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;_filename &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; process&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/file_get_contents&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;file_get_contents&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;_filename&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// Convert Mac/Win line breaks to Unix format.&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/str_replace&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;str_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\r&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/str_replace&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;str_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\r&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;doProcess&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;protected&lt;/span&gt; abstract &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; doProcess&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Note that I have omitted the comments in this (and further) code snippets; you can download the full script at the bottom of this post, with all comments.&lt;/p&gt;
&lt;p&gt;Save the file and make sure you have execute permissions. On Windows, you may want to set up a file association such that *.phpx is executed by php (or php_cli), and name the file accordingly. Another option is creating a .cmd file which runs the PHP script (passing all comand line arguments).&lt;/p&gt;
&lt;p&gt;The blob sets up a few things. The first line says the script is to be executed by PHP. Furthermore there is a &lt;em&gt;Preprocessor&lt;/em&gt; class, which reads a file and changes all types of newlines into Unix format, for convenience (code borrowed from the Drupal API module). It then calls the (abstract) &lt;em&gt;doProcess()&lt;/em&gt; function on the content. We&#039;ll work on this function in two child classes (the second one in part 3B). These will do the actual work.&lt;/p&gt;
&lt;p&gt;Now we&#039;ll add the &lt;em&gt;CodePreprocessor&lt;/em&gt; class which will handle our code files (.php, .module, .inc etc.). First things first: let&#039;s go and detect the comment blocks.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;php geshifilter-php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; CodePreprocessor &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;extends&lt;/span&gt; Preprocessor &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; __construct &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    Preprocessor&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;__construct&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; doProcess&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// Beyond Drupal&#039;s API module: we also work on blocks started with &amp;quot;/*!&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/preg_replace_callback&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;preg_replace_callback&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;@/\*[\*!](.*?)\*/@s&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;                                      &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;processCommentBlock&#039;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;                                      &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// And those with at least two lines of /// or //!&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/preg_replace_callback&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;preg_replace_callback&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;@(//[/!])[^\\n]*\\n(\\1[^\\n]*\\n)+@s&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;                                      &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;processCommentBlock&#039;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;                                      &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// Return processed file contents&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; processCommentBlock&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$matches&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$matches&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// ADD FUNCTION CALLS HERE LATER&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;doProcess&lt;/em&gt; implementation here finds comment structures indicating Doxygen documentation. Unlike Drupal&#039;s API module, this includes comment blocks starting with &#039;/*!&#039;, as well as blocks of at least two lines starting with &#039;///&#039; or &#039;//!&#039;. These are all blocks Doxygen will process, so we do the same. On each comment block, we call &lt;em&gt;processCommentBlock&lt;/em&gt;. This function gets the matches array from the regular expression (&lt;em&gt;$matches[0]&lt;/em&gt; being the complete match), and expects a string in return. The match will be replaced with that string. All in all a very useful place to do our processing.&lt;/p&gt;
&lt;h4&gt;Escaping unknown commands&lt;/h4&gt;
&lt;p&gt;Now for some actual preprocessing code. To get Doxygen to keep the &#039;@&#039; and &#039;%&#039; characters in the output (to solve our first problem), we have to escape them, i.e. put a backslash in front of them. But we don&#039;t want actual Doxygen commands to be ignored. Also, we might as well solve another problem at the same time: &lt;a href=&quot;http://api.drupal.org/api/function/drupal_match_path&quot;&gt;drupal_match_path()&lt;/a&gt; has documentation containing &quot;\r&quot; and &quot;\n&quot;. Drupal&#039;s API module doesn&#039;t replace the &quot;\n&quot; command, while Doxygen will throw in a newline. Also, Doxygen will complain about now knowing &quot;\r&quot; and discard it. Hence we&#039;ll also go and escape unknown backslash commands, and (valid!) backslash commands followed by a single letter (&lt;em&gt;\a&lt;/em&gt;, &lt;em&gt;\n&lt;/em&gt; etc), as long as they&#039;re not escaped already. So: &lt;em&gt;\r&lt;/em&gt; will become &lt;em&gt;\\r&lt;/em&gt; (and &lt;em&gt;\r&lt;/em&gt; again in the HTML output), but something saying &lt;em&gt;\\e scaped&lt;/em&gt; will remain the same.&lt;/p&gt;
&lt;p&gt;So, it&#039;s now time for some more magic with regular expressions. Add a function in the &lt;em&gt;CodePreprocessor&lt;/em&gt; class, which starts off listing all the known Doxygen commands:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;php geshifilter-php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; escapeUnknownCommands&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    static &lt;span style=&quot;color: #000088;&quot;&gt;$commandsArray&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;a&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;addindex&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;addtogroup&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;anchor&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;arg&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;attention&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;author&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;b&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;brief&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;bug&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;c&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;callgraph&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;callgraph&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;callergraph&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;category&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;class&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;code&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;cond&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;copybrief&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;copydetails&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;copydoc&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;date&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;def&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;defgroup&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;deprecated&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;details&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;dir&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;dontinclude&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;dot&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;dotfile&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;e&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;else&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;elseif&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;em&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endcode&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endcond&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;enddot&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endhtmlonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endif&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endlatexonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endlink&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endmanonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endmsc&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endverbatim&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endxmlonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;enum&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;example&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;exception&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;extends&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;file&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;fn&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;headerfile&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;hideinitializer&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;htmlinclude&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;htmlonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;if&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;ifnot&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;image&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;implements&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;include&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;includelineno&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;ingroup&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;internal&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;invariant&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;interface&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;latexonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;li&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;line&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;link&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;mainpage&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;manonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;memberof&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;msc&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;n&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;name&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;namespace&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;nosubgrouping&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;note&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;overload&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;p&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;package&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;page&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;paragraph&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;param&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;post&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;pre&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;private&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;privatesection&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;property&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;protected&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;protectedsection&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;public&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;publicsection&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;protocol&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;ref&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;relates&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;relatesalso&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;remarks&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;return&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;retval&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;sa&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;section&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;see&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;showinitializer&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;since&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;skip&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;skipline&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;struct&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;subpage&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;subsection&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;subsubsection&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;test&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;throw&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;todo&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;tparam&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;typedef&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;union&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;until&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;var&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;verbatim&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;verbinclude&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;version&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;warning&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;weakgroup&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;xmlonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;xrefitem&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;annotatedclasslist&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;classhierarchy&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;define&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;functionindex&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;header&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;headerfilelist&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;inherit&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;l&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;postheader&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    static &lt;span style=&quot;color: #000088;&quot;&gt;$backslashCommandsArray&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;addindex&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;addtogroup&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;anchor&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;arg&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;attention&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;author&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;brief&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;bug&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;callgraph&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;callgraph&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;callergraph&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;category&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;class&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;code&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;cond&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;copybrief&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;copydetails&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;copydoc&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;date&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;def&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;defgroup&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;deprecated&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;details&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;dir&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;dontinclude&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;dot&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;dotfile&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;else&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;elseif&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;em&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endcode&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endcond&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;enddot&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endhtmlonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endif&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endlatexonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endlink&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endmanonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endmsc&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endverbatim&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;endxmlonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;enum&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;example&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;exception&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;extends&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;file&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;fn&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;headerfile&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;hideinitializer&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;htmlinclude&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;htmlonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;if&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;ifnot&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;image&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;implements&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;include&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;includelineno&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;ingroup&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;internal&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;invariant&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;interface&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;latexonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;li&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;line&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;link&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;mainpage&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;manonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;memberof&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;msc&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;name&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;namespace&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;nosubgrouping&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;note&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;overload&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;package&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;page&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;paragraph&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;param&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;post&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;pre&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;private&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;privatesection&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;property&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;protected&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;protectedsection&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;public&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;publicsection&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;protocol&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;ref&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;relates&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;relatesalso&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;remarks&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;return&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;retval&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;sa&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;section&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;see&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;showinitializer&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;since&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;skip&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;skipline&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;struct&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;subpage&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;subsection&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;subsubsection&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;test&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;throw&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;todo&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;tparam&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;typedef&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;union&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;until&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;var&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;verbatim&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;verbinclude&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;version&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;warning&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;weakgroup&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;xmlonly&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;xrefitem&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;annotatedclasslist&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;classhierarchy&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;define&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;functionindex&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;header&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;headerfilelist&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;inherit&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;postheader&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    static &lt;span style=&quot;color: #000088;&quot;&gt;$noWordCommands&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;f[\$\[\]\{\}]&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;[\$@\\\\&amp;amp;~&amp;lt;&amp;gt;#%&amp;quot;]&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Now we&#039;ll use these arrays to construct the major regular expressions we need: two to escape unknown commands. Oh, and we don&#039;t forget to escape all those unescaped percentage characters. Expand the function you just made with:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;php geshifilter-php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    static &lt;span style=&quot;color: #000088;&quot;&gt;$backslashCommandRegex&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #009900; font-weight: bold;&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    static &lt;span style=&quot;color: #000088;&quot;&gt;$commandsRegex&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #009900; font-weight: bold;&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    static &lt;span style=&quot;color: #000088;&quot;&gt;$noWordCommandsRegex&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #009900; font-weight: bold;&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;!&lt;/span&gt;&lt;a href=&quot;http://www.php.net/isset&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$backslashCommandRegex&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #000088;&quot;&gt;$commandsRegex&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;/(^|(?&amp;lt;=\W))(?&amp;lt;!\\\\|@)@(?!&#039;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;a href=&quot;http://www.php.net/implode&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;implode&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;\W|&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$commandsArray&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;\W|&#039;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;                     &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;a href=&quot;http://www.php.net/implode&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;implode&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;|&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$noWordCommands&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;)/&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #000088;&quot;&gt;$backslashCommandRegex&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;/(^|(?&amp;lt;=\W))(?&amp;lt;!\\\\|@)\\\\(?!&#039;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;                             &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;a href=&quot;http://www.php.net/implode&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;implode&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;\W|&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$backslashCommandsArray&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;\W|&#039;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;                             &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;a href=&quot;http://www.php.net/implode&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;implode&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;|&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$noWordCommands&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;)/&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// First replace all unknown backslash commands that occur before commands&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/preg_replace&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;preg_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$backslashCommandRegex&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;\\\\\\\\&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// And unknown &#039;@&#039; prefixed commands&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/preg_replace&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;preg_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$commandsRegex&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;\@&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// Escape all unescaped percentage characters&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/preg_replace&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;preg_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;/(?&amp;lt;!\\\\|@)%/&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;\\\\%&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The regular expressions look complicated (especially because we have to do a lot of escaping of backslashes ourselves), but basically work as described above. The &#039;&lt;em&gt;noWordCommands&lt;/em&gt;&#039; array is separate, as such commands followed by a letter will be kept intact. If a regular command is followed by extra letters, we should still escape it (e.g. &lt;em&gt;@var&lt;/em&gt; should remain as such, but &lt;em&gt;@variable&lt;/em&gt; should become &lt;em&gt;\@variable&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;Now we still need to call the new function: place the following line in the main &lt;em&gt;processCommentBlock()&lt;/em&gt; function as described earlier, near the clearly marked comment:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;php geshifilter-php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;escapeUnknownCommands&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;h4&gt;Try it out&lt;/h4&gt;
&lt;p&gt;Before we can actually use our code, we&#039;ll have to add some code to control the preprocessor, at the bottom of the script (outside any classes):&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;php geshifilter-php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// Default to processing stdin if no arguments are given&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$argc&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000088;&quot;&gt;$argc&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000088;&quot;&gt;$argv&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;-&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// Process all files in argument list&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$i&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$i&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$argc&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000088;&quot;&gt;$filename&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$argv&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$filename&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;-&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #000088;&quot;&gt;$filename&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;php://stdin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// Find out type of file (based on filename)&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000088;&quot;&gt;$processor&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #009900; font-weight: bold;&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000088;&quot;&gt;$info&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/pathinfo&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;pathinfo&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;!&lt;/span&gt;&lt;a href=&quot;http://www.php.net/empty&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;empty&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;extension&#039;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;a href=&quot;http://www.php.net/in_array&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;in_array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;extension&#039;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;html&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;htm&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;xhtml&#039;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// HTML Processing is for later...&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #000088;&quot;&gt;$processor&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; CodePreprocessor&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// Process file&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #b1b100;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$processor&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;process&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;This code will create the &lt;em&gt;CodePreprocessor&lt;/em&gt; (we&#039;ll add a separate one for HTML files later). For each of the files in the script&#039;s arguments, we&#039;ll process the code and print out the results. It will fallback to standard input, allowing us to reuse this script for something outside Doxygen, if we ever find the need (&lt;em&gt;It was mainly useful for debugging the script above, allowing me to run it on selections or other files straight from my &lt;a href=&quot;http://www.kdevelop.org&quot;&gt;IDE&lt;/a&gt;&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;So let&#039;s try this script out now. Save it (I&#039;ll be using &lt;em&gt;/home/cheetah/public_html/drupal.api/preprocess-drupal-doxygen.php&lt;/em&gt; here) and open up the Doxygen wizard once again (as in &lt;a href=&quot;http://www.simply-life.net/cheetah/blog/2009-11-22/drupal-development-made-easier-qt-assistant-part-2&quot;&gt;part two&lt;/a&gt;). Change the &lt;strong&gt;INPUT_FILTER&lt;/strong&gt; in the &lt;strong&gt;Input&lt;/strong&gt; topic to point to your script. You may also want to add it to the excludes list (add &lt;em&gt;preprocess-drupal-doxygen.php&lt;/em&gt; the &lt;strong&gt;EXCLUDE&lt;/strong&gt; setting in the &lt;strong&gt;Input&lt;/strong&gt; topic), if you keep the script in your Drupal directory. This will prevent it from being included in your Drupal documentation.&lt;/p&gt;
&lt;div class=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/doxywizard4.png&quot; title=&quot;Doxywizard - INPUT_FILTER setting&quot; rel=&quot;lightshow[fixingdoc]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/doxywizard4.png&quot; alt=&quot;Doxywizard - INPUT_FILTER setting&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/doxywizard5.png&quot; title=&quot;Doxywizard - EXCLUDE setting&quot; rel=&quot;lightshow[fixingdoc]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/doxywizard5.png&quot; alt=&quot;Doxywizard - EXCLUDE setting&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Now if you run Doxygen and check out the documentation, you&#039;ll see if everything went well. If so, the documentation of &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;t()&lt;/code&gt;&lt;/span&gt; should now look as it does &lt;a href=&quot;http://api.drupal.org/api/function/t&quot;&gt;online&lt;/a&gt;. Good.&lt;/p&gt;
&lt;div class=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/fixeddoc1.png&quot; title=&quot;Repaired Documentation&quot; rel=&quot;lightshow[fixingdoc]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/fixeddoc1.png&quot; alt=&quot;Repaired Documentation&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/brokenfixeddoc1.png&quot; title=&quot;Broken and Repaired Documentation&quot; rel=&quot;lightshow[fixingdoc]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/brokenfixeddoc1.png&quot; alt=&quot;Broken and Repaired Documentation&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;h4&gt;Broken links&lt;/h4&gt;
&lt;p&gt;Something else you&#039;ll notice from the start is that the main page of your documentation will have some broken links. The group links (Module system, Database abstraction layer, etcetera) work just fine, as do those to the example modules, if you have included them in your documentation. However, the links to the constants, global variables and the in-depth discussions are all broken. Let&#039;s get those fixed as well, by expanding the preprocessor.&lt;/p&gt;
&lt;p&gt;First off, we want to fix the link to all the constants, or &lt;em&gt;enums&lt;/em&gt; in Doxygen. We know there&#039;s a page, but it&#039;s not at &lt;em&gt;/api/constants&lt;/em&gt;. We want to use &lt;em&gt;globals_enum.html&lt;/em&gt; instead; this page has all the &lt;em&gt;define()&lt;/em&gt; elements found in the code. So, we make it a regular anchor link (or &amp;lt;a&amp;gt; tag):&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;php geshifilter-php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; makeAnchorLinks&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$links&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$links&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$original&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$new&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #000088;&quot;&gt;$re&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;/@link &#039;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;a href=&quot;http://www.php.net/str_replace&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;str_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;/&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;\/&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$original&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;(\/\S*)?\s(.*\S)\s*@endlink/&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/preg_replace&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;preg_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$re&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;&amp;lt;a class=&amp;quot;el&amp;quot; href=&amp;quot;&#039;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$new&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;&amp;quot;&amp;gt;\\2&amp;lt;/a&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The following function will change our &lt;em&gt;/api/globals&lt;/em&gt; link to refer to the &lt;em&gt;globals.php&lt;/em&gt; documentation. This file, in the extra developer documentation, contains documented versions of all the Drupal (core) globals. Another option is to link to &lt;em&gt;globals_vars.html&lt;/em&gt; using the function above, which will include all global variables (and not just Drupal core ones). If you opt for that choice, the following function will not be necessary unless you find more broken links you want to fix.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;php geshifilter-php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; replaceLinks&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$links&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$links&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$original&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$new&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #000088;&quot;&gt;$re&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;/@link &#039;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;a href=&quot;http://www.php.net/str_replace&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;str_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;/&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;\/&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$original&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;(\/\S*)?\s(.*\S)\s*@endlink/&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/preg_replace&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;preg_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$re&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;@link &#039;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$new&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039; \\2 @endlink&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Place these both in your &lt;em&gt;CodePreprocessor&lt;/em&gt; class. Now call them as follows, after the call to &lt;em&gt;escapeUnknownCommands&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;php geshifilter-php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;makeAnchorLinks&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;/api/constants&#039;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;globals_enum.html&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;        &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// &#039;/api/globals&#039; =&amp;gt; &#039;globals_vars.html&#039;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: bold; font-style: italic;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;replaceLinks&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;/api/globals&#039;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;globals.php&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Note the commented line? That&#039;s the alternative for the globals; remove/comment the other line mentioning &lt;em&gt;/api/globals&lt;/em&gt; if you prefer the &lt;em&gt;global_vars.html&lt;/em&gt; page (you can still access that through the Files, then Globals in the Doxygen navigation). Note that the code is flexible in that you can easily add more links. It will also automatically change longer URLs, if the extra part starts with a forward slash (e.g. &lt;em&gt;/api/constants/7&lt;/em&gt; will also be caught as a whole, but &lt;em&gt;/api/constants_7&lt;/em&gt; is considered to be a different link).&lt;/p&gt;
&lt;p&gt;Now to deal with any external links (like the &quot;&lt;a href=&quot;http://drupal.org/node/547518&quot;&gt;Drupal Programming from an Object-Oriented Perspective&lt;/a&gt;&quot; link on the main page). The following function will remove the used &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;@link&lt;/code&gt;&lt;/span&gt; command, and replace it with an HTML tag again, which will not be touched by Doxygen.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;php geshifilter-php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; replaceExternalLinks&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;a href=&quot;http://www.php.net/preg_replace&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;preg_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;/@link (([a-zA-Z]+:\/\/|mailto\:)\S*)\s+(.*\S)\s*@endlink/&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;                 &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;&amp;lt;a class=&amp;quot;el&amp;quot; href=&amp;quot;\\1&amp;quot;&amp;gt;\\3&amp;lt;/a&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;And the call:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;php geshifilter-php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;pre style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;replaceExternalLinks&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Note that any protocol (&lt;em&gt;http://&lt;/em&gt;, &lt;em&gt;ftp://&lt;/em&gt; etc) will be caugt as external. The &lt;em&gt;mailto:&lt;/em&gt; protocol is dealt with somewhat separately, as it doesn&#039;t have the two slashes after it, but other than that everything&#039;s the same. The whole URL, until the first space, is considered to be the actual URL to link to. The rest is the text that is linked. If you want to go a little bit further, you could even add code to show the URL as linked text, if nothing else is present (Doxygen will work that one out if you remove the &lt;em&gt;@link&lt;/em&gt; and &lt;em&gt;@endlink&lt;/em&gt; commands). I&#039;ll leave that as exercise to the reader.&lt;/p&gt;
&lt;h4&gt;Summary&lt;/h4&gt;
&lt;p&gt;So... wow. This post has turned out longer than expected. I&#039;ve attached a renewed Doxyfile (with only the extra &lt;strong&gt;INPUT_FILTER&lt;/strong&gt; and expanded &lt;strong&gt;EXCLUDE&lt;/strong&gt; settings), as well as the code so far to this post. The major pains in the Doxygen code are now solved, making the documentation of Drupal more suitable for Doxygen itself. All of this work is useful whether or not you use the Qt Assistant; as soon as you use Doxygen instead of Drupal&#039;s API module, you&#039;ll probably want to have issues described here to be fixed.&lt;/p&gt;
&lt;p&gt;Next is not part 4, but 3b. We&#039;ll continue fixing the documentation by having Doxygen properly include and find the HTML pages containing documentation, such as the Forms API reference. It&#039;ll be a quicker now we have a base to work from!&lt;/p&gt;
&lt;table id=&quot;attachments&quot; class=&quot;sticky-enabled&quot;&gt;
 &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Attachment&lt;/th&gt;&lt;th&gt;Size&lt;/th&gt; &lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
 &lt;tr class=&quot;odd&quot;&gt;&lt;td&gt;&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/Doxyfile_0.&quot;&gt;Doxyfile.&lt;/a&gt;&lt;/td&gt;&lt;td&gt;62.95 KB&lt;/td&gt; &lt;/tr&gt;
 &lt;tr class=&quot;even&quot;&gt;&lt;td&gt;&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/preprocess-drupal-doxygen.php_.txt&quot;&gt;preprocess-drupal-doxygen.php_.txt&lt;/a&gt;&lt;/td&gt;&lt;td&gt;9.55 KB&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</description>
 <comments>http://www.simply-life.net/cheetah/blog/2010-07-27/drupal-development-made-easier-qt-assistant-part-3a#comments</comments>
 <category domain="http://www.simply-life.net/cheetah/tag/drupal">Drupal</category>
 <category domain="http://www.simply-life.net/cheetah/tag/open-source">Open Source</category>
 <category domain="http://www.simply-life.net/cheetah/tag/qt">Qt</category>
 <enclosure url="http://www.simply-life.net/cheetah/system/files/Doxyfile_0." length="64461" type="application/octet-stream" />
 <pubDate>Tue, 27 Jul 2010 09:07:02 +0000</pubDate>
 <dc:creator>ChEeTaH</dc:creator>
 <guid isPermaLink="false">68 at http://www.simply-life.net/cheetah</guid>
</item>
<item>
 <title>Drupal Development made easier with Qt Assistant - Part 2</title>
 <link>http://www.simply-life.net/cheetah/blog/2009-11-22/drupal-development-made-easier-qt-assistant-part-2</link>
 <description>&lt;!--break--&gt;&lt;!--break--&gt;&lt;p&gt;In the &lt;a href=&quot;http://www.simply-life.net/cheetah/blog/2009-11-10/drupal-development-made-easier-qt-assistant-part-1&quot;&gt;previous part&lt;/a&gt; of this walk-through, we installed the necessary software to get our Drupal API documentation in Qt Assistant. The next step is to actually generate the documentation so we can browse through it, search it and more. If you haven&#039;t done so already, read &lt;a href=&quot;http://www.simply-life.net/cheetah/blog/2009-11-10/drupal-development-made-easier-qt-assistant-part-1&quot;&gt;part 1&lt;/a&gt; so you&#039;re sure to have the right software.&lt;/p&gt;
&lt;h4&gt;Creating a Doxyfile&lt;/h4&gt;
&lt;p&gt;The first thing we need to do is creating a configuration file for Doxygen. This will contain instructions for Doxygen about the formats you want the documentation to be in, where to get the documentation from, etc. I&#039;ll show the settings in the graphical tool, &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;doxywizard&lt;/code&gt;&lt;/span&gt;. Of course it&#039;s also possible to let the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;doxygen&lt;/code&gt;&lt;/span&gt; command generate the file for you so you can edit it manually (with a text editor). Either way is fine. If you want to use the Doxyfile generated through this tutorial straight away, scroll to the bottom of this post to download it.&lt;/p&gt;
&lt;p&gt;So, let&#039;s start the Doxygen wizard. You should find this in your launcher menu, probably under the Development submenu, or you can just run &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;doxywizard&lt;/code&gt;&lt;/span&gt; from a terminal. The window you get presented asks you, as a first step, to select the working directory. Point this to your Drupal directory. For me this would be &lt;em&gt;/home/cheetah/public_html/drupal.api&lt;/em&gt;. Now, as we want to set some advanced settings, we skip straight to the &lt;em&gt;Expert&lt;/em&gt; tab to configure everything.&lt;/p&gt;
&lt;p&gt;The first things to pay attention for are the &lt;strong&gt;PROJECT_NAME&lt;/strong&gt; (&quot;&lt;em&gt;drupal&lt;/em&gt;&quot;), &lt;strong&gt;PROJECT_NUMBER&lt;/strong&gt; (&quot;&lt;em&gt;6&lt;/em&gt;&quot; or whichever Drupal version you&#039;re working with), and the &lt;strong&gt;OUTPUT_DIRECTORY&lt;/strong&gt; settings. For the last setting, creating a new place for Doxygen to dump its files in is the easiest way to prevent the Doxygen output from cluttering your Drupal installation. I&#039;ve put it in a &lt;em&gt;doxygen&lt;/em&gt; subdirectory (&quot;&lt;em&gt;/home/cheetah/public_html/drupal.api/doxygen&lt;/em&gt;&quot;). You&#039;ll probably also want to enable the &lt;strong&gt;REPEAT_BRIEF&lt;/strong&gt; and &lt;strong&gt;ALWAYS_DETAILED_SEC&lt;/strong&gt; as well. The &lt;strong&gt;STRIP_FROM_PATH&lt;/strong&gt; setting should be empty, but it also doesn&#039;t hurt to enter the base directory of your Drupal installation (this way, if your run Doxygen outside the Drupal directory, it&#039;ll still properly strip the path from the filenames). I&#039;ve also enabled the &lt;strong&gt;QT_AUTOBRIEF&lt;/strong&gt; and &lt;strong&gt;OPTIMIZE_OUTPUT_FOR_C&lt;/strong&gt; options.&lt;/p&gt;
&lt;p&gt;There&#039;s a final important setting on the &lt;strong&gt;Project&lt;/strong&gt; topic, which is the &lt;strong&gt;EXTENSION_MAPPING&lt;/strong&gt;. Generally, Drupal uses &lt;em&gt;*.php&lt;/em&gt;, &lt;em&gt;*.module&lt;/em&gt; and &lt;em&gt;*.inc&lt;/em&gt; filenames for code. However, we need to tell Doxygen that these are PHP files. Add &quot;&lt;em&gt;module=PHP&lt;/em&gt;&quot; and &quot;&lt;em&gt;install=PHP&lt;/em&gt;&quot; (according to the documentation, you should omit the &quot;.&quot; in front of the extension).&lt;/p&gt;
&lt;div class=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/doxywizard1.png&quot; title=&quot;DoxyWizard - Project Settings&quot; rel=&quot;lightshow[doxywizard]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/doxywizard1.png&quot; alt=&quot;DoxyWizard - Project Settings&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Next tab is the &lt;strong&gt;Build&lt;/strong&gt; topic. We want to get all the documentation, so we extract &lt;strong&gt;ALL&lt;/strong&gt;, &lt;strong&gt;PRIVATE&lt;/strong&gt;, &lt;strong&gt;STATIC&lt;/strong&gt;, &lt;strong&gt;LOCAL_CLASSES&lt;/strong&gt; and &lt;strong&gt;LOCAL_METHODS&lt;/strong&gt;. The &lt;strong&gt;SHOW_DIRECTORIES&lt;/strong&gt; setting may be useful to have the directory structure visible in the documentation. We skip straight to the &lt;strong&gt;Input&lt;/strong&gt; topic, and add our Drupal directory as &lt;strong&gt;INPUT&lt;/strong&gt; setting. Important is the &lt;strong&gt;FILE_PATTERNS&lt;/strong&gt; setting: this tells Doxygen which files contain documentation. The &lt;em&gt;*.php&lt;/em&gt; and &lt;em&gt;*.inc&lt;/em&gt; should normally already be in there, but for Drupal add the &lt;em&gt;*.module&lt;/em&gt; and &lt;em&gt;*.install&lt;/em&gt; patterns as well. This way Doxygen should extract documentation from most if not all of the code files in Drupal (unfortunately Doxygen doesn&#039;t work well with Javascript).&lt;/p&gt;
&lt;p&gt;Also enable the &lt;strong&gt;RECURSIVE&lt;/strong&gt; option, otherwise you&#039;ll need to tell Doxygen explicitly which directories it should look in for documentation, in the &lt;strong&gt;INPUT&lt;/strong&gt; setting. If you keep a directory with backups of old modules within the Drupal directory, enter its path in the &lt;strong&gt;EXCLUDE&lt;/strong&gt; setting (e.g. &quot;&lt;em&gt;backup&lt;/em&gt;&quot;). As &lt;strong&gt;EXCLUDE_PATTERNS&lt;/strong&gt; some useful entries may be &lt;em&gt;*/CVS/*&lt;/em&gt;, &lt;em&gt;*/.svn/*&lt;/em&gt;, &lt;em&gt;*/.git/*&lt;/em&gt; (so Doxygen skips version-controlled directories), plus &lt;em&gt;*/settings.php&lt;/em&gt; and &lt;em&gt;*/*.settings.php&lt;/em&gt; to ignore site-specific settings files.&lt;/p&gt;
&lt;div class=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/doxywizard2.png&quot; title=&quot;DoxyWizard - Input Settings&quot; rel=&quot;lightshow[doxywizard]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/doxywizard2.png&quot; alt=&quot;DoxyWizard - Input Settings&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Next up is the &lt;strong&gt;HTML&lt;/strong&gt; topic, in which we configure the HTML output Doxygen generates. Yes, we want to generate HTML (switch on &lt;strong&gt;GENERATE_HTML&lt;/strong&gt;) in the &lt;em&gt;html&lt;/em&gt; subdirectory (&lt;strong&gt;HTML_OUTPUT&lt;/strong&gt;) with the &lt;em&gt;.html&lt;/em&gt; extension for the files (&lt;strong&gt;HTML_FILE_EXTENSION&lt;/strong&gt;). Now a very important setting to generate the Qt Help files, which Qt Assistant uses. Switch on &lt;strong&gt;GENERATE_QHP&lt;/strong&gt;. For &lt;strong&gt;QCH_FILE&lt;/strong&gt;, which just became enabled, set &lt;em&gt;drupal-6.qch&lt;/em&gt; (or just &lt;em&gt;drupal.qch&lt;/em&gt;, or replace the 6 with the version of Drupal you&#039;re working with). Set the &lt;strong&gt;QHP_NAMESPACE&lt;/strong&gt; to &lt;em&gt;org.drupal.6&lt;/em&gt; (again, replace the version number). Set &lt;em&gt;all&lt;/em&gt; as the &lt;strong&gt;QHP_VIRTUAL_FOLDER&lt;/strong&gt; - this will come in handy later. Also set the filter settings: &lt;strong&gt;QHP_CUST_FILTER_NAME&lt;/strong&gt; to &lt;em&gt;&quot;Drupal 6 (all)&quot;&lt;/em&gt;, and set both &lt;strong&gt;QHP_CUST_FILTER_ATTRS&lt;/strong&gt; and &lt;strong&gt;QHP_SECT_FILTER_ATTRS&lt;/strong&gt; to &lt;em&gt;drupal drupal-6&lt;/em&gt;. Finally, we set the path to the &quot;&lt;em&gt;qhelpgenerator&lt;/em&gt;&quot; program (&quot;&lt;em&gt;qhelpgenerator.exe&lt;/em&gt;&quot; on Windows, I assume) in the &lt;strong&gt;QHG_LOCATION&lt;/strong&gt; setting. This is probably something like &quot;&lt;em&gt;/usr/bin/qhelpgenerator&lt;/em&gt;&quot; or &quot;&lt;em&gt;C:/Qt/bin/qhelpgenerator.exe&lt;/em&gt;&quot;. Leave the other settings at their defaults (&lt;strong&gt;DISABLE_INDEX&lt;/strong&gt; off, &lt;strong&gt;GENERATE_TREEVIEW&lt;/strong&gt; to &lt;em&gt;none&lt;/em&gt;, etc.).&lt;/p&gt;
&lt;div class=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/doxywizard3.png&quot; title=&quot;DoxyWizard - HTML Settings&quot; rel=&quot;lightshow[doxywizard]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/doxywizard3.png&quot; alt=&quot;DoxyWizard - HTML Settings&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Finally, head to the &lt;strong&gt;LaTeX&lt;/strong&gt;, &lt;strong&gt;RTF&lt;/strong&gt;, &lt;strong&gt;Man&lt;/strong&gt; and &lt;strong&gt;XML&lt;/strong&gt; topics, and turn output for each of these off. We won&#039;t be using these. Finally, if you want to, enable or disable class diagrams on the &lt;strong&gt;Dot&lt;/strong&gt; topic. This will make a difference for some contributed modules (mostly Views).&lt;/p&gt;
&lt;h4&gt;First Run&lt;/h4&gt;
&lt;p&gt;We&#039;re all set now, so let&#039;s run Doxygen! Go to the &lt;strong&gt;Run&lt;/strong&gt; tab, click the &lt;strong&gt;Run doxygen&lt;/strong&gt; button and let it do its work. When it&#039;s done (don&#039;t close the Doxygen Wizard until I tell you to!), click &quot;&lt;strong&gt;Show HTML Output&lt;/strong&gt;&quot; and your browser will start with the Drupal documentation right at your hands.  Unless you excluded the &quot;&lt;em&gt;sites&lt;/em&gt;&quot; subdirectory, you also get all the documentation of contributed modules as well. You may notice some problems with broken links (e.g. the Form API reference etc), and the documentation is a little bit messy if you have many contributed modules. We&#039;ll solve these problems in the next part. First, let&#039;s exit the wizard. It will ask us to save the configuration. Save it under its default name (that would be &quot;&lt;em&gt;/home/cheetah/public_html/drupal.api/doxygen/Doxyfile&lt;/em&gt;&quot; in my case). You&#039;ll find the sample file created in this tutorial at the bottom of this post.&lt;/p&gt;
&lt;div class=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/documentation1.png&quot; title=&quot;Drupal Documentation&quot; rel=&quot;lightshow[doxywizard]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/documentation1.png&quot; alt=&quot;Drupal Documentation&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Last step for today is loading up the Qt Assistant with our documentation. This will require using a terminal/command line. First make sure you know where Qt Assistant is located. The program is called just &lt;strong&gt;assistant&lt;/strong&gt;, so for most platforms you should be able to find it using &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;which assistant&lt;/code&gt;&lt;/span&gt; on the terminal. On Windows, look in your Qt installation path, in the &lt;em&gt;bin&lt;/em&gt; directory. Now decide for a location for your Qt Help Collection file. Create an empty file with any name you like (e.g. &lt;em&gt;drupal-6.qhc&lt;/em&gt;). You can use the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;touch&lt;/code&gt;&lt;/span&gt; command to do so, or by creating an empty file in that directory using your file manager (that would be the way to go for Windows users; use Explorer or Notepad and create the empty file. Make sure the extension is &lt;strong&gt;.qhc&lt;/strong&gt; and not &lt;strong&gt;.txt&lt;/strong&gt; or something else!). Now, assuming you&#039;ve chosen the filename to be &lt;strong&gt;drupal-6.qhc&lt;/strong&gt; in your home directory (and your username is &lt;em&gt;cheetah&lt;/em&gt;) enter in a terminal:&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;/usr/bin/assistant -collectionFile /home/cheetah/drupal-6.qhc&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You can also just set up a shortcut to do this, of course. You should see an empty Qt Assistant:&lt;/p&gt;
&lt;div class=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/qtassistant4.png&quot; title=&quot;Empty Assistant&quot; rel=&quot;lightshow[drupalassistant]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/qtassistant4.png&quot; alt=&quot;Empty Assistant&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;As long as this is the first time you&#039;re starting up the assistant with this file, you can head to the &lt;em&gt;Edit&lt;/em&gt; &amp;gt; &lt;em&gt;Preferences&lt;/em&gt; menu. Go to the &lt;em&gt;Documentation&lt;/em&gt; tab, click &lt;em&gt;Add...&lt;/em&gt; and add the &lt;em&gt;drupal-6.qch&lt;/em&gt; file created by Doxygen (this will be in the &lt;em&gt;doxygen/html&lt;/em&gt; directory within your Drupal installation, if you followed this tutorial). Qt Assistant will start updating its indexes, and you get to see and search your documentation:&lt;/p&gt;
&lt;div class=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/qtassistant5.png&quot; title=&quot;Adding Collections to the Assistant&quot; rel=&quot;lightshow[drupalassistant]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/qtassistant5.png&quot; alt=&quot;Adding Collections to the Assistant&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/qtassistant6.png&quot; title=&quot;Drupal Documentation in Assistant&quot; rel=&quot;lightshow[drupalassistant]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/qtassistant6.png&quot; alt=&quot;Drupal Documentation in Assistant&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;You&#039;ll find out that once you restart the assistant with the same collectionFile parameter, the &lt;em&gt;Documentation&lt;/em&gt; tab will disappear from the preferences, even after removing and recreating the file. If this happened, you can still register and unregister help files from the collection file, from the command line as follows (change the filenames etc. of course):&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;assistant -collectionFile drupal-6.qhc -register /home/cheetah/public_html/drupal.api/doxygen/html/drupal-6.qch&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To remove the help file from the collection again:&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;assistant -collectionFile drupal-6.qhc -unregister /home/cheetah/public_html/drupal.api/doxygen/html/drupal-6.qch&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;These commands will tell you if something useful happened, but won&#039;t actually start the assistant. Restart the assistant with just the &lt;em&gt;collectionFile&lt;/em&gt; parameter again to just see the documentation.&lt;/p&gt;
&lt;p&gt;Note that as long as the Qt Compressed Help file (the one generated by Doxygen) stays in the same place, you should be able to update it and see the changes in the assistant if you ever recreate the documentation. The assistant will automatically recreate its index and take care of such updates for you. Knowing that, you can create an icon that fires up the assistant for you, with the Drupal help loaded, so you can get that quick documentation access. Just use the above command above the empty assistant screenshot. Make sure you do give the proper path to the collection file!&lt;/p&gt;
&lt;h4&gt;Updates&lt;/h4&gt;
&lt;p&gt;If you ever want to update the documentation (for example because you added more contributed modules, updated Drupal to a newer version, etc), regenerate it with Doxygen. You can use the wizard to open the Doxyfile you saved, rerun Doxygen and the assistant should show the updated documentation after you start it again. It&#039;s as simple as that. Alternatively, using a terminal, head to your Drupal directory (or wherever you stored the Doxyfile) and simply call &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;doxygen&lt;/code&gt;&lt;/span&gt;. As long as you&#039;ve explicitly set the &lt;strong&gt;INPUT&lt;/strong&gt; setting above, then run &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;doxygen /path/to/Doxyfile&lt;/code&gt;&lt;/span&gt; and so you can even use a different filename for your Doxygen configuration. Of course you can also play with the various Doxygen settings, rerun doxygen, and you&#039;ll also get the documentation with the new settings in Qt Assistant.&lt;/p&gt;
&lt;p&gt;Of course you don&#039;t have to use a separate collection file (*.qhc) for each version of Drupal you have. You can put each version of Drupal in the same assistant. Now if you made sure you have different namespaces (hence we placed the version numbers in the configuration), you should be able to filter per version at the top of the UI.&lt;/p&gt;
&lt;h4&gt;Summary&lt;/h4&gt;
&lt;p&gt;Last time all we did was install the necessary software. This time we actually used it all in the most basic way, with success: the Qt Assistant now displays the Drupal documentation. This should be enough to get you started finding all the information of the Drupal API that you need. There are still some problems with broken links to special topics, there&#039;s no way to filter out specific module information, and so on.&lt;/p&gt;
&lt;p&gt;With the major steps taken, next time I&#039;ll dig a little deeper in fixing the most painful problems. It probably won&#039;t be as much work as this part. See you next time!&lt;/p&gt;
&lt;table id=&quot;attachments&quot; class=&quot;sticky-enabled&quot;&gt;
 &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Attachment&lt;/th&gt;&lt;th&gt;Size&lt;/th&gt; &lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
 &lt;tr class=&quot;odd&quot;&gt;&lt;td&gt;&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/Doxyfile.&quot;&gt;Doxyfile.&lt;/a&gt;&lt;/td&gt;&lt;td&gt;62.83 KB&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</description>
 <comments>http://www.simply-life.net/cheetah/blog/2009-11-22/drupal-development-made-easier-qt-assistant-part-2#comments</comments>
 <category domain="http://www.simply-life.net/cheetah/tag/drupal">Drupal</category>
 <category domain="http://www.simply-life.net/cheetah/tag/open-source">Open Source</category>
 <category domain="http://www.simply-life.net/cheetah/tag/qt">Qt</category>
 <enclosure url="http://www.simply-life.net/cheetah/system/files/Doxyfile." length="64337" type="application/octet-stream" />
 <pubDate>Sun, 22 Nov 2009 22:36:49 +0000</pubDate>
 <dc:creator>ChEeTaH</dc:creator>
 <guid isPermaLink="false">64 at http://www.simply-life.net/cheetah</guid>
</item>
<item>
 <title>Drupal Development made easier with Qt Assistant - Part 1</title>
 <link>http://www.simply-life.net/cheetah/blog/2009-11-10/drupal-development-made-easier-qt-assistant-part-1</link>
 <description>&lt;!--break--&gt;&lt;!--break--&gt;&lt;p&gt;If you&#039;ve followed my blog for even the smallest bit, you&#039;ll know I have KDE 4 as my desktop environment. I&#039;ve also done quite some development (mostly messing around so far, just tContact is published) for Drupal. One of the main tools to help me during development is the Qt Assistant, which comes with Qt 4 and later. It&#039;s a fast documentation viewer, with a great index making it easy to look up all those little details about each function that&#039;s available in Qt4... or Drupal. Let me show you how I&#039;ve set things up...&lt;/p&gt;
&lt;p&gt;Oh, and if you&#039;re not that into all this techy stuff: feel free to stop reading, of course.&lt;/p&gt;
&lt;h4&gt;Some quick notes&lt;/h4&gt;
&lt;p&gt;First of all: this guide is focused on getting the Drupal API in the Qt Assistant, but it should work for pretty much any C++/PHP/Java/Python project etc. which Doxygen can handle. See the &lt;a href=&quot;http://www.stack.nl/~dimitri/doxygen/&quot;&gt;Doxygen website&lt;/a&gt; for details on how to document your code et cetera. Unfortunately I have not been able to get the PHP documentation itself integrated in Qt Assistant yet.&lt;/p&gt;
&lt;p&gt;I will also be using some scripts to be run from a terminal or shell. This should not be much of a problem for you Linux or Mac users, for Windows it might be necessary to get &lt;a href=&quot;http://www.cygwin.com&quot;&gt;CygWin&lt;/a&gt;. Unfortunately I haven&#039;t tried all of this from Windows, so if someone can jump in and post useful/necessary tips for Windows users in the comments, that would be helpful.&lt;/p&gt;
&lt;h4&gt;Preparing your system&lt;/h4&gt;
&lt;p&gt;Well, you&#039;re still here. First thing to do is to install Qt4. You get it from &lt;a href=&quot;http://www.qtsoftware.com&quot;&gt;QtSoftware.com&lt;/a&gt; for pretty much any platform. Get the LGPL/Free version of the Framework or SDK. Note that on Linux it&#039;ll very likely come with the repositories of your distribution, you may just need to install the -dev or -devel packages.&lt;/p&gt;
&lt;p&gt;Next, get a copy of Drupal from &lt;a href=&quot;http://www.drupal.org&quot;&gt;Drupal.org&lt;/a&gt; and extract it somewhere on your hard drive. You can of course use your existing Drupal installation full with all the modules you like, or just whichever product you want to use in combination with the Assistant (as long as you have access to the source code). You can do this several times for any version of Drupal, so you can even get separate access to your Drupal 5, 6 and 7 documentation. The choice is yours. No need to actually install it, just make sure the source is available.&lt;/p&gt;
&lt;p&gt;For Drupal you&#039;ll also want to pull the Developer documentation from CVS. These contain some special help pages like the FAPI Reference and more, as well as documentation about all the hooks (&lt;em&gt;hook_*&lt;/em&gt; functions). I won&#039;t repeat the exact instructions on how to get the documentation. Just follow the &lt;a href=&quot;http://drupal.org/node/144223&quot;&gt;instructions at drupal.org&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Finally, get Doxygen (&lt;a href=&quot;http://www.stack.nl/~dimitri/doxygen/&quot;&gt;www.stack.nl/~dimitri/doxygen/&lt;/a&gt;). For Linux users: this is probably also in your distribution&#039;s repositories. This is the tool that will extract the documentation from your source code, and place it in useful HTML files - and finally in Qt Assistant too.&lt;/p&gt;
&lt;h4&gt;Qt Assistant - A Quick Look&lt;/h4&gt;
&lt;p&gt;Now that we have the necessary software installed, you could just take a quick peek at what Qt Assistant does for Qt. You should find it in your launcher/start menu/wherever (Mac: /Developer/Applications/Qt), or just by running &quot;&lt;em&gt;assistant&lt;/em&gt;&quot; from the terminal. Go ahead and try it, you should see something similar to this:&lt;/p&gt;
&lt;div class=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/qtassistant1.png&quot; title=&quot;Qt Assistant - Home&quot; rel=&quot;lightshow[qtassistant]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/qtassistant1.png&quot; alt=&quot;Qt Assistant&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Now let&#039;s look up the documentation of a function we know (part of) the name of: &lt;em&gt;aboutQt()&lt;/em&gt;. Hit the &lt;em&gt;Index&lt;/em&gt; tab on the left, enter &lt;em&gt;about&lt;/em&gt; and you&#039;ll see a list of matching declarations (as well as some more generic topics). Double click &lt;em&gt;aboutQt&lt;/em&gt; and Qt Assistant will prompt you to choose in which topic you want to look, &lt;em&gt;QApplication&lt;/em&gt; or &lt;em&gt;QMessageBox&lt;/em&gt;. I&#039;ve opted for &lt;em&gt;QApplication&lt;/em&gt; in the screenshot below, some actual documentation!&lt;/p&gt;
&lt;div class=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/qtassistant2.png&quot; title=&quot;Qt Assistant - Index Search&quot; rel=&quot;lightshow[qtassistant]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/qtassistant2.png&quot; alt=&quot;Qt Assistant&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Finally one feature I don&#039;t use as often, but which is lightning fast: the Search. You&#039;ll find this tab on the right, just above the documentation. Searching for &quot;&lt;em&gt;about&lt;/em&gt;&quot; will give you something like below, very useful if you only know the general topic of something you need:&lt;/p&gt;
&lt;div class=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.simply-life.net/cheetah/system/files/qtassistant3.png&quot; title=&quot;Qt Assistant - Full Text Search&quot; rel=&quot;lightshow[qtassistant]&quot;&gt;&lt;img src=&quot;http://www.simply-life.net/cheetah/system/files/imagecache/thumbnail/qtassistant3.png&quot; alt=&quot;Qt Assistant&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Play around a bit and if you&#039;re daring: see if you can already get your Drupal documentation in there. That&#039;s what&#039;s coming up in the next part - the entire Drupal (and contributed) API, without even mixing it up with the Qt documentation.&lt;/p&gt;
</description>
 <comments>http://www.simply-life.net/cheetah/blog/2009-11-10/drupal-development-made-easier-qt-assistant-part-1#comments</comments>
 <category domain="http://www.simply-life.net/cheetah/tag/drupal">Drupal</category>
 <category domain="http://www.simply-life.net/cheetah/tag/open-source">Open Source</category>
 <category domain="http://www.simply-life.net/cheetah/tag/qt">Qt</category>
 <pubDate>Tue, 10 Nov 2009 22:53:23 +0000</pubDate>
 <dc:creator>ChEeTaH</dc:creator>
 <guid isPermaLink="false">58 at http://www.simply-life.net/cheetah</guid>
</item>
</channel>
</rss>

