Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jan 2012 11:20:55 -0700 (MST)
From:      Warren Block <wblock@wonkity.com>
To:        Hiroki Sato <hrs@FreeBSD.org>
Cc:        freebsd-doc@FreeBSD.org
Subject:   Re: Tidy and HTML tab spacing
Message-ID:  <alpine.BSF.2.00.1201261055280.20643@wonkity.com>
In-Reply-To: <alpine.BSF.2.00.1201201231090.61386@wonkity.com>
References:  <alpine.BSF.2.00.1201181520140.40712@wonkity.com> <20120119.084434.926306642968660094.hrs@allbsd.org> <alpine.BSF.2.00.1201181748230.42380@wonkity.com> <20120119.155736.1127622096127250170.hrs@allbsd.org> <alpine.BSF.2.00.1201201231090.61386@wonkity.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 20 Jan 2012, Warren Block wrote:

> The suggestion of &#09; is interesting.  The problem is that tidy is changing 
> tabs to spaces while still reading the file, when it really should be 
> treating the tab as a special entity while processings tags.

Some further testing...

There are actually three versions of tidy: www/tidy, www/tidy-devel, 
and www/tidy-lib.  Although the docproj port installs the last, any can 
be used.

Replacing tabs with &#09; before tidy is called is probably the most 
compatible way.  The attached patch does this with sed in the three 
doc Makefiles where tidy is used: doc.docbook.mk, doc.html.mk, 
doc.xml.mk.

How it actually works is either funny or appalling, depending on how you 
look at it.  sed replaces tabs with &#09;, then tidy translates the 
&#09; back to tabs.  Since this happens after the tabs-to-spaces code in 
tidy, the output is a literal tab.

The Makefile changes work with any of the versions of tidy.

A sample of the Porter's Handbook produced with this patch:
http://www.wonkity.com/~wblock/porters/book.html

Firefox 9 on FreeBSD renders the Makefile examples perfectly.

(Firefox 9 in WINE does not render them correctly either with tabs or 
spaces.)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1201261055280.20643>