From owner-freebsd-doc Wed Aug 23 18:30: 9 2000 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E41AC37B424 for ; Wed, 23 Aug 2000 18:30:06 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id SAA86301; Wed, 23 Aug 2000 18:30:06 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Wed, 23 Aug 2000 18:30:06 -0700 (PDT) Message-Id: <200008240130.SAA86301@freefall.freebsd.org> To: freebsd-doc@freebsd.org Cc: From: Brooks Davis Subject: Re: docs/20028: ASCII docs should reflect tags in the source Reply-To: Brooks Davis Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR docs/20028; it has been noted by GNATS. From: Brooks Davis To: freebsd-doc@freebsd.org Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: docs/20028: ASCII docs should reflect tags in the source Date: Wed, 23 Aug 2000 18:28:35 -0700 On Tue, Jul 18, 2000 at 10:54:04PM -0700, brooks@one-eyed-alien.net wrote: > >Description: > > When the tag is used in DocBook, this is translated to a > variant on the tag in HTML vi the style sheets. The HTML docs are > then processed by w3m to produce ASCII versions. w3m appears to > compleatly ignore tags even in interative mode and it ignores both > and tags in -dump mode. This means that no indication of > emphasis is transmitted to the ASCII form which potentialy distorts the > text's meaning. > > >Fix: > > The fix is going to be something like patching w3m to have a mode where > it emphasises things like *this* or something. I've looked into this a little today. It looks like creating a patch which accomplishes this is pretty easy, but there are a few hoops to jump though. First, w3m delibratly doesn't support tags at all. It parses them, but throws them out. This could be corrected if we wanted to do so. What is supported is which maps to which in turn maps to . I've generated a patch so blah becomes *blah* when -dump is specified. There's a good chance this is the wrong way to do this, but it works for me. How would people suggest I proceed? Should I implement Nik's suggestion of bold -> *bold* and italics -> /italics/ or just what? My concern about Nik's suggesion is that is used in a number of places including FAQ Query's which I think it will look silly. I'm kinda thinking the right thing to do may be to change the style sheets to translate to and only dealing with in w3m. -- Brooks This patch will add *bold* support to w3m in dump mode. It should be applied after the other patches in the port. --- file.c.freebsd Wed Aug 23 17:58:07 2000 +++ file.c Wed Aug 23 18:13:22 2000 @@ -2507,6 +2507,7 @@ #ifdef ID_EXT Str id = NULL; #endif /* ID_EXT */ + extern int w3m_dump; if (obuf->flag & RB_PRE) { switch (cmd) { @@ -2520,16 +2521,25 @@ switch (cmd) { case HTML_B: - obuf->in_bold++; - if (obuf->in_bold > 1) - return 1; + if(!w3m_dump) { + obuf->in_bold++; + if (obuf->in_bold > 1) + return 1; + } else { + HTMLlineproc1("*", h_env); + } return 0; case HTML_N_B: - if (obuf->in_bold == 1 && close_effect0(obuf, HTML_B)) - obuf->in_bold = 0; - if (obuf->in_bold > 0) { - obuf->in_bold--; - if (obuf->in_bold == 0) + if(!w3m_dump) { + if (obuf->in_bold == 1 && close_effect0(obuf, HTML_B)) + obuf->in_bold = 0; + if (obuf->in_bold > 0) { + obuf->in_bold--; + if (obuf->in_bold == 0) + return 0; + } + } else { + HTMLlineproc1("*", h_env); return 0; } return 1; -- Any statement of the form "X is the one, true Y" is FALSE. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message