Linux HOWTOs

About | Home | Search


HOWTO: tidy
Description: HTML tidying tool
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# HTML Tidy
# =========
# Prerequisites:
# Git
# CMake
# xsltproc (for the man page)

# Clone the source from Git
mkdir -p -m 0700 ~/src
cd ~/src
test -d ./tidy-html5 &&
 ( cd tidy-html5 ; git fetch )
test ! -d ./tidy-html5 &&
 git clone https://github.com/htacg/tidy-html5.git
cd tidy-html5

# Read ./README.md
# Read ./README/BUILD.md or 'lynx README/README.html'

# To install it as /usr/bin/tidy, pass this to cmake
# -DCMAKE_INSTALL_PREFIX=/usr
# For other build options, see ./CMakeLists.txt

# Run 'make clean' if there's an old Makefile from a previous build
test -f ./Makefile && make clean

# Configure the build
cd build/cmake
cmake ../.. -DCMAKE_BUILD_TYPE=Release \
 -DLIB_INSTALL_DIR=/usr/local/lib64 \
 -DMAN_INSTALL_DIR=/usr/local/man/man1

# Build it
make

# Become root to install it
su

# Install it
make install
ldconfig

# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .

# Become your non-root user again
exit

# Note where it is
cd
mkdir -p -m 0700 installed
echo "~/src/tidy-html5" > ~/installed/tidy-html5.README


# If you ever want to uninstall HTML Tidy, this should do it:
cd
su
rm -f /usr/local/bin/tidy /usr/local/man/man1/tidy.1
( cd /usr/local/include
  rm -f tidy.h tidybuffio.h tidyenum.h tidyplatform.h )
for libdir in /usr/local/lib /usr/local/lib64;
do
  test -d $libdir &&
   ( cd $libdir
     rm -f libtidy.so libtidy.so.* libtidys.a pkgconfig/tidy.pc )
done
ldconfig
exit
rm -f ~/installed/tidy-html5.README

Back to the list


Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>