tidy-html5/README
2018-09-02 20:53:36 +02:00
..
API_AND_NAMESPACE.md Continue the documentation effort! 2017-03-22 16:05:13 -04:00
ATTRIBUTES.md Continue the documentation effort! 2017-03-22 16:05:13 -04:00
BRANCHES.md Update README documents with information for the upcoming 5.4.0 release. 2017-02-24 14:30:42 -05:00
BUILD.md Fix typo 2017-11-13 08:21:35 -02:00
CODESTYLE.md Corrected description of pointer operator-macro order. 2017-03-03 07:17:28 -05:00
CONTRIBUTING.md Is #718 PR #727 - Update to CONTRIBUTING.md.2.txt 2018-05-01 14:57:48 +02:00
LICENSE.md Merge the two different license files and add contributors 2016-07-01 10:15:26 +01:00
LICENSE.txt Make LICENSE.txt equivalent to LICENSE.md 2017-03-24 15:19:07 +01:00
LOCALIZE.md Update README documents with information for the upcoming 5.4.0 release. 2017-02-24 14:30:42 -05:00
MESSAGES.md Updated the MESSAGES.md readme for the updated message system. 2017-09-06 20:50:31 -04:00
OPTIONS.md Update the OPTIONS.md readme file. 2017-05-11 14:54:53 -04:00
README.html Update README documents with information for the upcoming 5.4.0 release. 2017-02-24 14:30:42 -05:00
RELEASE.md Is #741 - Elim. dup 2018-09-02 20:53:36 +02:00
TAGS.md Continue the documentation effort! 2017-03-22 16:05:13 -04:00
verhist.log Issue #600 - Update README/verhist.log 2017-11-25 14:54:41 +01:00
VERSION.md Continue the documentation effort! 2017-03-22 16:05:13 -04:00

<h1 id="htacghtmltidy">HTACG HTML Tidy</h1>

<h2 id="prerequisites">Prerequisites</h2>

<ol>
<li><p>git - <a href="http://git-scm.com/book/en/v2/Getting-Started-Installing-Git">http://git-scm.com/book/en/v2/Getting-Started-Installing-Git</a></p></li>
<li><p>cmake - <a href="http://www.cmake.org/download/">http://www.cmake.org/download/</a></p></li>
<li><p>appropriate build tools for the platform</p></li>
<li><p>the <a href="http://xmlsoft.org/XSLT/xsltproc2.html">xsltproc</a> tool is required to build and install the <code>tidy.1</code> man page on Unix-like platforms.</p></li>
</ol>

<p>CMake comes in two forms - command line and GUI. Some installations only install one or the other, but sometimes both. The build commands below are only for command line use.</p>

<p>Also the actual build tools vary for each platform. But that is one of the great features of CMake, it can generate variuous &#8216;native&#8217; build files. Running <code>cmake --help</code> should list the generators available on that platform. For sure one of the common ones is &#8220;Unix Makefiles&#8221;, which needs autotools make installed, but many other generators are supported.</p>

<p>In Windows CMake offers various versions for MSVC. Again below only the command line use of MSVC is shown, but the tidy solution (*.sln) file can be loaded into the MSVC IDE, and the building done in there.</p>

<h2 id="buildthetidylibraryandcommandlinetool">Build the tidy library and command line tool</h2>

<ol>
<li><p><code>cd build/cmake</code></p></li>
<li><p><code>cmake ../.. -DCMAKE_BUILD_TYPE=Release [-DCMAKE_INSTALL_PREFIX=/path/for/install]</code></p></li>
<li><p>Windows: <code>cmake --build . --config Release</code><br/>
 Unix/OS X: <code>make</code></p></li>
<li><p>Install, if desired:<br/>
 Windows: <code>cmake --build . --config Release --target INSTALL</code><br/>
 Unix/OS X: <code>[sudo] make install</code></p></li>
</ol>

<p>By default cmake sets the install path to <code>/usr/local/bin</code> in Unix. If you wanted the binary in say <code>/usr/bin</code> instead, then in 2. above use <code>-DCMAKE_INSTALL_PREFIX=/usr</code>.</p>

<p>Also, in Unix if you want to build the release library without any debug <code>assert</code> in the code then add <code>-DCMAKE_BUILD_TYPE=Release</code> in step 2. This adds a <code>-DNDEBUG</code> macro to the compile switches. This is normally added in windows build for the <code>Release</code> config.</p>

<p>In Windows the default install is to <code>C:\Program Files\tidy</code>, or <code>C:/Program Files (x86)/tidy</code>, which is not very useful. After the build the <code>tidy.exe</code> is in the <code>Release</code> directory, and can be copied to any directory in your <code>PATH</code> environment variable for global use.</p>

<p>If you do <strong>not</strong> need the tidy library built as a &#8216;shared&#8217; (DLL) library, then in 2. add the command <code>-DBUILD_SHARED_LIB:BOOL=OFF</code>. This option is <strong>ON</strong> by default. The static library is always built and linked with the command line tool for convenience in Windows, and so the binary can be run as part of the man page build without the shared library being installed in unix.</p>

<p>See the <code>CMakeLists.txt</code> file for other CMake <strong>options</strong> offered.</p>

<h2 id="buildphpwiththetidy-html5library">Build PHP with the tidy-html5 library</h2>

<p>Due to API changes in the PHP source, <code>buffio.h</code> needs to be renamed to <code>tidybuffio.h</code> in the file <code>ext/tidy/tidy.c</code> in PHP&#8217;s source.</p>

<p>That is - prior to configuring PHP run this in the PHP source directory:
<code>
sed -i 's/buffio.h/tidybuffio.h/' ext/tidy/*.c
</code></p>

<p>And then continue with (just an example here, use your own PHP config options):</p>

<pre><code>./configure --with-tidy=/usr/local
make
make test
make install
</code></pre>

<p>; eof</p>