tidy-html5/README
Daniel James 5b23fd2f7d Update LICENSE.md
Change date to match LICENSE.txt
2016-06-27 15:18:10 +01:00
..
CODESTYLE.md looks like a pre-processor left "; eof" in some of the outputted markdown files 2016-01-20 16:53:00 -08:00
CONTRIBUTING.md Merge pull request #359 from htacg/localize_rc 2016-01-30 16:02:39 +08:00
LICENSE.md Update LICENSE.md 2016-06-27 15:18:10 +01:00
LICENSE.txt - Consolidated README documents into root-level subdir. 2015-10-31 09:21:55 +08:00
LOCALIZE.md Localization Support added to HTML Tidy 2016-01-30 15:51:53 +08:00
OPTIONS.md Issue #348 - Add README/OTPIONS.md on adding a new option 2016-03-20 01:05:36 +01:00
README.html - Consolidated README documents into root-level subdir. 2015-10-31 09:21:55 +08:00
README.md Updated broken links in readme. 2016-03-11 16:39:17 +08:00
verhist.log Update verhist.log to 5.1.25 2015-11-23 16:07:04 +01:00
VERSION.md looks like a pre-processor left "; eof" in some of the outputted markdown files 2016-01-20 16:53:00 -08:00

HTML Tidy with HTML5 support

Prerequisites

  1. git - http://git-scm.com/book/en/v2/Getting-Started-Installing-Git

  2. cmake - http://www.cmake.org/download/

  3. appropriate build tools for the platform

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 the command line use.

Also the actual build tools vary for each platform. But that is one of the great features of cmake, it can generate variuous 'native' build files. Running cmake without any parameters will list the generators available on that platform. For sure one of the common ones is "Unix Makefiles", which needs autotools make installed, but many other generators are supported.

In windows cmake offers various versions of 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.

Build the tidy library and command line tool

  1. cd build/cmake

  2. cmake ../.. [-DCMAKE_INSTALL_PREFIX=/path/for/install]

  3. Windows: cmake --build . --config Release
    Unix/OS X: make

  4. Install, if desired:
    Windows: cmake --build . --config Release --target INSTALL
    Unix/OS X: [sudo] make install

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

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

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

If you do not need the tidy library built as a 'shared' (DLL) library, then in 2. add the command -DBUILD_SHARED_LIB:BOOL=OFF. This option is ON 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.

Build PHP with the tidy-html5 library

Due to API changes in the PHP source, "buffio.h" needs to be changed to "tidybuffio.h" in the file ext/tidy/tidy.c.

That is - prior to configuring php run this in the php source directory:

sed -i 's/buffio.h/tidybuffio.h/' ext/tidy/*.c

And then continue with (just an example here, use your own php config options):

./configure --with-tidy=/usr/local
make
make test
make install

Development

The default branch of this repository is master. This is the development branch, hopefully always stable source.

It will identify as library version X.odd.X. Use it to help us on the forever bug quest, addition of new features, options, ..., etc.

However, if you seek release code, then do git branch -r, and choose one of the release/X.even.0 branches for your build and install...

This will always be the latest release branch. Important bug fixes thought relevant to this release, pushed back, may bump the library version to X.even.1, ..., etc, but will be remain known as X.even...

Some more details of the Tidy Version can be found in VERSION.md.

Concerning the Tidy Code Style, some notes can be found in CODESTYLE.md.

If you want to contribute to Tidy, then read CONTRIBUTING.md.

History

This repository should be considered canonical for HTML Tidy as of 2015-January-15.