Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Aug 2000 18:28:35 -0700
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        freebsd-doc@freebsd.org
Cc:        FreeBSD-gnats-submit@freebsd.org
Subject:   Re: docs/20028: ASCII docs should reflect <emphasis> tags in the source
Message-ID:  <20000823182835.A25522@Odin.AC.HMC.Edu>
In-Reply-To: <200007190554.WAA12534@minya.sea.one-eyed-alien.net>; from brooks@one-eyed-alien.net on Tue, Jul 18, 2000 at 10:54:04PM -0700
References:  <200007190554.WAA12534@minya.sea.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jul 18, 2000 at 10:54:04PM -0700, brooks@one-eyed-alien.net wrote:
> >Description:
> 
> When the <emphasis> tag is used in DocBook, this is translated to a
> variant on the <i> tag in HTML vi the style sheets.  The HTML docs are
> then processed by w3m to produce ASCII versions.  w3m appears to
> compleatly ignore <i> tags even in interative mode and it ignores both
> <i> and <b> 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 <i> tags at all.
It parses them, but throws them out.  This could be corrected if we
wanted to do so.  What is supported is <strong> which maps to <em> which
in turn maps to <b>.  I've generated a patch so <b>blah</b> 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 <b>bold</b> -> *bold*
and <i>italics</i> -> /italics/ or just what?  My concern about Nik's
suggesion is that <B> 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 <emphasis> to
<em> and only dealing with <em> 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




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