From owner-freebsd-doc@FreeBSD.ORG Thu Jan 19 01:13:49 2012 Return-Path: Delivered-To: freebsd-doc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45A0F1065672 for ; Thu, 19 Jan 2012 01:13:49 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 052918FC08 for ; Thu, 19 Jan 2012 01:13:48 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id q0J1DmFF042616; Wed, 18 Jan 2012 18:13:48 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id q0J1DmBm042613; Wed, 18 Jan 2012 18:13:48 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Wed, 18 Jan 2012 18:13:48 -0700 (MST) From: Warren Block To: Hiroki Sato In-Reply-To: <20120119.084434.926306642968660094.hrs@allbsd.org> Message-ID: References: <20120119.084434.926306642968660094.hrs@allbsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Wed, 18 Jan 2012 18:13:48 -0700 (MST) Cc: freebsd-doc@FreeBSD.org Subject: Re: Tidy and HTML tab spacing X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 01:13:49 -0000 On Thu, 19 Jan 2012, Hiroki Sato wrote: > Warren Block wrote > in : > > wb> HTML versions of FreeBSD documents are fed through tidy (www/tidy or > wb> www/tidy-devel) for cleanup. There's a bug in tidy[1] that can cause > wb> tab stops to be wrong: > wb> http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-distfiles.html#AEN1623 > wb> > wb> Note how DISTNAME and EXTRACT_SUFX do not line up. They are correct > wb> in the source book.sgml. > wb> > wb> So what to do? > > I lean to fixing Tidy if possible. The reason why we are using Tidy > is to fix mark-ups in rendered results from various tools like Jade, > not (only) for human-readability. The results of Tidy are still not > perfect from viewpoint of standard conformance, but it is better than > nothing even if most of modern www browsers can handle the rendered > HTMLs directly. Agreed. > wb> 4. Add newlines to the HTML in the build process before it gets to > wb> tidy: > wb> s/CLASS="PROGRAMLISTING"\n>/CLASS="PROGRAMLISTING">\n/ > > I think this will break the results because a newline just after ">" > is recognized as CDATA. A test run on the Porter's Handbook did seem to work: make -C /usr/ports/www/tidy-devel deinstall make clean book.html perl -0777 -i -pe 's/CLASS="PROGRAMLISTING"\n\>/CLASS="PROGRAMLISTING"\>\n/g' book.html make -C /usr/ports/www/tidy-devel install clean tidy -wrap 90 -m -raw -preserve -f /dev/null -asxml book.html