tidy-html5/README
Jim Derry 0d173d61d7 HTTPS Migration
- Updated links with working https versions from http.
- Removed rotten links.
- Updated links that have since resolved to new addresses.
- Generated all new po's and pot from existing headers.
- Updated the regression tests to account for the new https:// URLS, and the
  changed reference to specification.
2021-07-21 17:21:27 -04: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 BRANCHES.md 2019-01-16 18:38:00 -08:00
BUILD.md HTTPS Migration 2021-07-21 17:21:27 -04:00
CHANGELOG.md Releasing HTML Tidy 5.8.0 2021-07-10 16:52:01 -04:00
CODESTYLE.md Spelling fixes, thanks to @jschleus. 2021-07-21 15:50:53 -04: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 Spelling fixes, thanks to @jschleus. 2021-07-21 15:50:53 -04:00
OPTIONS.md HTTPS Migration 2021-07-21 17:21:27 -04:00
README.html HTTPS Migration 2021-07-21 17:21:27 -04:00
RELEASE.md Releasing HTML Tidy 5.8.0 2021-07-10 16:52:01 -04:00
TAGS.md HTTPS Migration 2021-07-21 17:21:27 -04:00
TESTING.md Spelling fixes, thanks to @jschleus. 2021-07-21 15:50:53 -04:00
VERSION.md HTTPS Migration 2021-07-21 17:21:27 -04:00

README.html

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

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

<ol>
<li><p>git - <a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">https://git-scm.com/book/en/v2/Getting-Started-Installing-Git</a></p></li>
<li><p>cmake - <a href="https://cmake.org/download/">https://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 various &#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>