From owner-freebsd-doc Fri Apr 11 03:45:08 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id DAA10374 for doc-outgoing; Fri, 11 Apr 1997 03:45:08 -0700 (PDT) Received: from palrel3.hp.com (palrel3.hp.com [15.253.88.10]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA10317; Fri, 11 Apr 1997 03:44:47 -0700 (PDT) Received: from fakir.india.hp.com (fakir.india.hp.com [15.10.40.3]) by palrel3.hp.com with ESMTP (8.7.5/8.7.3) id DAA00312; Fri, 11 Apr 1997 03:44:41 -0700 (PDT) Received: from localhost by fakir.india.hp.com with SMTP (1.37.109.20/15.5+ECS 3.3) id AA088227335; Fri, 11 Apr 1997 16:15:35 +0500 Message-Id: <199704111115.AA088227335@fakir.india.hp.com> To: jfieber@freebsd.org Cc: freebsd-doc@freebsd.org Subject: Some enhancements to docbook-html.ts Date: Fri, 11 Apr 1997 16:15:35 +0500 From: "A JOSEPH KOSHY" Sender: owner-doc@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In the process of using Docbook to write a paper I had occasion to enhance the translation spec in a few places: - FOOTNOTE and FOOTNOTEREF are now decoupled so that we can have multiple references to one footnote instance. This works, but is a hack; I wasn't able to think up a clearer way, sorry. This currently uses an auxiliary script `process-footnotes'. - ABSTRACT elements now generate a properly formatted abstract at the beginning of the document. - LEGALNOTICE elements are now formatted correctly - PUBDATE works correctly - AUTHORGROUP, AUTHOR, AFFILIATION, ADDRESS are better in what they produce, but they are still not perfect. - EMAIL generates angle-bracket delimited email addresses. - THEAD, ROW (TABLE) output now explicitly sets alignment. Not sure how this could be generalized to allow user control. - GRAPHIC elements now generate an inline construct allowing embedded figures on the HTML page. - TITLE elements that are children of SIMPLESECT and VARIABLELIST work correctly now. A context diff is enclosed; thanks for the good work! Comments are welcome. PS: Should I send-pr this too? Koshy My Personal Opinions Only ------------------------------------------------------------------------------ *** /usr/share/sgml/transpec/docbook-html.ts Tue Apr 1 20:15:15 1997 --- ./docbook-html.ts Fri Apr 11 13:35:22 1997 *************** *** 52,58 **** ! '> '> '> --- 52,58 ---- ! '> '> '> *************** *** 153,158 **** --- 153,161 ---- anchorinhibit 0 + + fnotefile !echo /tmp/instant$$ + *************** *** 164,170 **** ABSTRACT ! ${_action &r.anchor;t} --- 167,174 ---- ABSTRACT ! ^${_action &r.anchor;t}<HR NOSHADE> ! <HR NOSHADE>^ *************** *** 205,220 **** ADDRESS ${_action &r.blkps;t} ! <P> ! </P> ${_action &r.blkpe;t} AFFILIATION - - <BR> --- 209,222 ---- ADDRESS ${_action &r.blkps;t} ! <ADDRESS> ! </ADDRESS> ${_action &r.blkpe;t} AFFILIATION *************** *** 345,352 **** AUTHOR ! ^<P> ! --- 347,354 ---- AUTHOR ! ^<P ALIGN="LEFT"> ! </P>^ *************** *** 357,362 **** --- 359,367 ---- AUTHORGROUP + + <P ALIGN="LEFT"> + </P> *************** *** 431,444 **** BOOK ! ^<!-- Generated on ${date} using ${transpec} --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML><TITLE>${_followrel descendant TITLE &r.pass;}</TITLE> ! <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> ${_isset inchdr &r.inchdr;}^ ^${_set fnotenum 1}${_action &r.fnote;t} ${_isset incftr &r.incftr;} ! </BODY></HTML> --- 436,449 ---- BOOK ! ${_! rm -f ${fnotefile}}^<!-- Generated on ${date} using ${transpec} --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML><TITLE>${_followrel descendant TITLE &r.pass;}</TITLE> ! <BODY BGCOLOR="#F0F0F0" TEXT="#000000"> ${_isset inchdr &r.inchdr;}^ ^${_set fnotenum 1}${_action &r.fnote;t} ${_isset incftr &r.incftr;} ! </BODY></HTML>${_! rm -f ${fnotefile}} *************** *** 684,691 **** EMAIL ! <A HREF="mailto:${_action &r.pass;}"> ! </A> FOOTNOTEREF --- 859,873 ---- FOOTNOTE all FOOTNOTEREF + + ${_! echo "${fnotenum} ${LINKEND}" >> ${fnotefile}}<A NAME="rfn-${fnotenum}"></A><SUP><SMALL><A HREF="#fn-${LINKEND}">[${fnotenum}]</A></SMALL></SUP> + fnotenum *************** *** 973,979 **** GRAPHIC ${_action &r.blkps;t} ! <P><A HREF="${_filename}">[image]</A></P> ${_action &r.blkpe;t} --- 979,985 ---- GRAPHIC ${_action &r.blkps;t} ! <P><IMG SRC="${_filename}"></P> ${_action &r.blkpe;t} *************** *** 1228,1233 **** --- 1234,1242 ---- LINK + + <A HREF="#${LINKEND}"> + </A> --- 1640,1647 ---- PUBDATE ! <DIV ALIGN="LEFT">Last Revised: ! </DIV> *************** *** 1809,1815 **** ROW ! ^<TR valign="top">^ ^</TR>^ --- 1818,1824 ---- ROW ! ^<TR ALIGN="LEFT" VALIGN="TOP">^ ^</TR>^ *************** *** 2283,2288 **** --- 2292,2315 ---- &hlcfont;</H1>^ + + + TITLE + ABSTRACT + + ^<H2>&hlofont; + &hlcfont;</H2>^ + + + + + TITLE + LEGALNOTICE + + ^<H3>&hlofont; + &hlcfont;</H2>^ + + TITLE *************** *** 2439,2444 **** --- 2466,2480 ---- all + + + TITLE + SIMPLESECT + + ^<H4>&hlofont; + &hlcfont;</H4>^ + + TITLE *************** *** 2447,2457 **** --- 2483,2502 ---- all + + + TITLE + VARIABLELIST + + all + + TITLE + TITLEABBREV *************** *** 2561,2567 **** VARIABLELIST ! ${_action &r.blkps;t} <DL>^ ^</DL> ${_action &r.blkpe;t} --- 2606,2612 ---- VARIABLELIST ! ${_action &r.blkps;t}<STRONG>${_followrel child TITLE &r.pass;}</STRONG> <DL>^ ^</DL> ${_action &r.blkpe;t} *************** *** 2773,2779 **** descendant FOOTNOTE ! <H1>&hlofont;Notes&hlcfont;</H1> <TABLE width="100%"> ${_find top gi FOOTNOTE &r.fnotei;} </TABLE> --- 2818,2824 ---- descendant FOOTNOTE ! <HR NOSHADE WIDTH="100%"><BR><H1>&hlofont;Footnotes&hlcfont;</H1> <TABLE width="100%"> ${_find top gi FOOTNOTE &r.fnotei;} </TABLE> *************** *** 2783,2789 **** _fnote ! ^<TR><TD VALIGN="TOP"><B><A NAME="fn-${fnotenum}"></A><A HREF="#rfn-${fnotenum}">${fnotenum}.</A></B></TD> <TD VALIGN="TOP"> </TD><TR> fnotenum --- 2828,2835 ---- _fnote ! ^<TR><TD VALIGN="TOP"><B><A NAME="fn-${fnotenum}"></A><A NAME="fn-${ID}"></A> ! ${_! process-footnotes ${fnotefile} ${ID} } <TD VALIGN="TOP"> </TD><TR> fnotenum ------------------------------------------------------------------------------ *** /dev/null Fri Apr 11 16:11:58 1997 --- ./process-footnotes Fri Apr 11 16:14:14 1997 *************** *** 0 **** --- 1,11 ---- + #!/bin/sh + + footnotefile=$1 + pattern=$2 + shift; shift; + + awk " + /$pattern$/ { + printf(\"%s
\n\",\$1,\$1); + } + " $footnotefile