Date: Fri, 27 Jan 2012 08:54:08 -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.1201270821540.28751@wonkity.com> In-Reply-To: <20120127.222427.2203865340894432901.hrs@allbsd.org> References: <20120127.124619.1645166101623286100.hrs@allbsd.org> <alpine.BSF.2.00.1201262148480.25316@wonkity.com> <20120127.155054.2121952239893273004.hrs@allbsd.org> <20120127.222427.2203865340894432901.hrs@allbsd.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Fri, 27 Jan 2012, Hiroki Sato wrote: > Hiroki Sato <hrs@freebsd.org> wrote > in <20120127.155054.2121952239893273004.hrs@allbsd.org>: > > hr> I think the attached patch should fix the issue in the PDF format. > hr> Could you test it? > > The previous patch did not include width calculation of the tab > expansion (always used 8 spaces). The attached one does it for a > simple character sequence. That helps a lot! Single tabs and multiple tabs are slightly different, but it's close. http://www.wonkity.com/~wblock/porters/tab1.png (good!) http://www.wonkity.com/~wblock/porters/tab2.png (close) http://www.wonkity.com/~wblock/porters/tab3.png Should be: LIB_DEPENDS+= foo.0:${PORTSDIR}/devel/foo CONFIGURE_ARGS+= --enable-foo The second line '=' lands right before a tab stop, and the tab is replaced with a single space. Thanks! PS: somehow I missed escaping the '#' in my patch to doc.common.mk, revision attached. [-- Attachment #2 --] Index: doc/share/mk/doc.common.mk =================================================================== RCS file: /home/dcvs/doc/share/mk/doc.common.mk,v retrieving revision 1.18 diff -u -r1.18 doc.common.mk --- doc/share/mk/doc.common.mk 2 Nov 2006 18:58:17 -0000 1.18 +++ doc/share/mk/doc.common.mk 27 Jan 2012 15:30:17 -0000 @@ -9,6 +9,9 @@ GREP?= /usr/bin/grep REALPATH?= /bin/realpath SED?= /usr/bin/sed +# a hack to keep tidy from converting tabs to spaces +# replace them with 	 before calling tidy +REINPLACE_TABS_CMD?= ${SED} -i -e 's/ /\&\#09;/g' .if defined(DOC_PREFIX) && !empty(DOC_PREFIX) WEB_PREFIX?= ${DOC_PREFIX}/../www Index: doc/share/mk/doc.docbook.mk =================================================================== RCS file: /home/dcvs/doc/share/mk/doc.docbook.mk,v retrieving revision 1.129 diff -u -r1.129 doc.docbook.mk --- doc/share/mk/doc.docbook.mk 15 May 2011 20:41:31 -0000 1.129 +++ doc/share/mk/doc.docbook.mk 27 Jan 2012 15:30:17 -0000 @@ -525,6 +525,7 @@ ${DOC}.xml .endif .if !defined(NO_TIDY) + ${REINPLACE_TABS_CMD} $$(${XARGS} < HTML.manifest) -${TIDY} ${TIDYOPTS} $$(${XARGS} < HTML.manifest) .endif @@ -545,6 +546,7 @@ ${DOC}.xml > ${.TARGET} .endif .if !defined(NO_TIDY) + ${REINPLACE_TABS_CMD} ${.TARGET} -${TIDY} ${TIDYOPTS} ${.TARGET} .endif Index: doc/share/mk/doc.html.mk =================================================================== RCS file: /home/dcvs/doc/share/mk/doc.html.mk,v retrieving revision 1.21 diff -u -r1.21 doc.html.mk --- doc/share/mk/doc.html.mk 25 Feb 2006 23:19:40 -0000 1.21 +++ doc/share/mk/doc.html.mk 27 Jan 2012 15:30:17 -0000 @@ -144,6 +144,7 @@ ${DOC}.html: ${SRCS} ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} ${LOCAL_CSS_SHEET} ${SGMLNORM} -c ${HTMLCATALOG} ${SRCS:S|^|${.CURDIR}/|} > ${.TARGET} .if !defined(NO_TIDY) + ${REINPLACE_TABS_CMD} ${.TARGET} -${TIDY} ${TIDYOPTS} ${.TARGET} .endif Index: doc/share/mk/doc.xml.mk =================================================================== RCS file: /home/dcvs/doc/share/mk/doc.xml.mk,v retrieving revision 1.15 diff -u -r1.15 doc.xml.mk --- doc/share/mk/doc.xml.mk 9 Aug 2011 06:32:50 -0000 1.15 +++ doc/share/mk/doc.xml.mk 27 Jan 2012 15:30:17 -0000 @@ -385,6 +385,7 @@ ${XSLT.${_ID}} ${XML.${_ID}} . if !defined(NO_TIDY) || empty(NO_TIDY) . if !defined(NO_TIDY.${_ID}) || empty(NO_TIDY.${_ID}) + ${REINPLACE_TABS_CMD} ${.TARGET} -${TIDY} ${TIDYOPTS} ${.TARGET} . endif . endifhelp
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1201270821540.28751>
