source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Use <em> for .Em and .Bf -emphasis.
Date: Wed, 13 Aug 2014 11:25:22 -0400 (EDT)	[thread overview]
Message-ID: <201408131525.s7DFPM4r015860@krisdoz.my.domain> (raw)

Log Message:
-----------
Use <em> for .Em and .Bf -emphasis.

The vast majority of .Em in real-world manuals is stress emphasis,
for which <em> is the correct markup.  Admittedly, there are some
instances of .Em usage for alternate quality, for which <i> would
be a better match.  Most of these are technical terms that neither
allow semantic markup nor are keywords - for the latter, .Sy would
be preferable.  A typical example is that the shell breaks input into
.Em words .
Alternate voice or mood, which would also require <i>, is almost
absent from manuals.
We cannot satisfy both stress emphasis and alternate quality, so
pick the one that fits more often and looks less wrong when off.

Patch from Guy Harris <guy at alum dot mit dot edu>.
ok joerg@ bentley@

Modified Files:
--------------
    mdocml:
        example.style.css
        html.c
        html.h
        mdoc_html.c
        style.css

Revision Data
-------------
Index: style.css
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/style.css,v
retrieving revision 1.25
retrieving revision 1.26
diff -Lstyle.css -Lstyle.css -u -p -r1.25 -r1.26
--- style.css
+++ style.css
@@ -34,7 +34,7 @@ td.head-rtitle	{ width: 10%; text-align:
 /* General font modes. */
 
 i		{ } /* Italic: BI, IB, I, (implicit). */
-.emph		{ font-style: italic; font-weight: normal; } /* Emphasis: Em, Bl -emphasis. */
+em		{ font-style: italic; font-weight: normal; } /* Emphasis: Em, Bl -emphasis. */
 b		{ } /* Bold: SB, BI, IB, BR, RB, B, (implicit). */
 .symb		{ font-style: normal; font-weight: bold; } /* Symbolic: Sy, Ms, Bf -symbolic. */
 small		{ } /* Small: SB, SM. */
Index: html.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/html.h,v
retrieving revision 1.51
retrieving revision 1.52
diff -Lhtml.h -Lhtml.h -u -p -r1.51 -r1.52
--- html.h
+++ html.h
@@ -50,6 +50,7 @@ enum	htmltag {
 	TAG_I,
 	TAG_CODE,
 	TAG_SMALL,
+	TAG_EM,
 	TAG_MAX
 };
 
Index: html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/html.c,v
retrieving revision 1.160
retrieving revision 1.161
diff -Lhtml.c -Lhtml.c -u -p -r1.160 -r1.161
--- html.c
+++ html.c
@@ -74,6 +74,7 @@ static	const struct htmldata htmltags[TA
 	{"i",		0 }, /* TAG_I */
 	{"code",	0 }, /* TAG_CODE */
 	{"small",	0 }, /* TAG_SMALL */
+	{"em",		0 }, /* TAG_EM */
 };
 
 static	const char	*const htmlattrs[ATTR_MAX] = {
Index: mdoc_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v
retrieving revision 1.196
retrieving revision 1.197
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.196 -r1.197
--- mdoc_html.c
+++ mdoc_html.c
@@ -1083,10 +1083,8 @@ mdoc_ex_pre(MDOC_ARGS)
 static int
 mdoc_em_pre(MDOC_ARGS)
 {
-	struct htmlpair	tag;
 
-	PAIR_CLASS_INIT(&tag, "emph");
-	print_otag(h, TAG_SPAN, 1, &tag);
+	print_otag(h, TAG_EM, 0, NULL);
 	return(1);
 }
 
@@ -1822,9 +1820,7 @@ mdoc_bf_pre(MDOC_ARGS)
 	else if (MDOC_BODY != n->type)
 		return(1);
 
-	if (FONT_Em == n->norm->Bf.font)
-		PAIR_CLASS_INIT(&tag[0], "emph");
-	else if (FONT_Sy == n->norm->Bf.font)
+	if (FONT_Sy == n->norm->Bf.font)
 		PAIR_CLASS_INIT(&tag[0], "symb");
 	else if (FONT_Li == n->norm->Bf.font)
 		PAIR_CLASS_INIT(&tag[0], "lit");
@@ -1842,6 +1838,8 @@ mdoc_bf_pre(MDOC_ARGS)
 	bufcat_su(h, "margin-left", &su);
 	PAIR_STYLE_INIT(&tag[1], h);
 	print_otag(h, TAG_DIV, 2, tag);
+	if (FONT_Em == n->norm->Bf.font)
+		print_otag(h, TAG_EM, 0, NULL);
 	return(1);
 }
 
Index: example.style.css
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/example.style.css,v
retrieving revision 1.49
retrieving revision 1.50
diff -Lexample.style.css -Lexample.style.css -u -p -r1.49 -r1.50
--- example.style.css
+++ example.style.css
@@ -30,7 +30,7 @@ div.mandoc .list		{ } /* All Bl. */
 div.mandoc i			{ } /* Italic: BI, IB, I, (implicit). */
 div.mandoc b			{ } /* Bold: SB, BI, IB, BR, RB, B, (implicit). */
 div.mandoc small		{ } /* Small: SB, SM. */
-div.mandoc .emph		{ font-style: italic; font-weight: normal; } /* Emphasis: Em, Bl -emphasis. */
+div.mandoc em			{ font-style: italic; font-weight: normal; } /* Emphasis: Em, Bl -emphasis. */
 div.mandoc .symb		{ font-style: normal; font-weight: bold; } /* Symbolic: Sy, Ms, Bf -symbolic. */
 div.mandoc .lit			{ font-style: normal; font-weight: normal; font-family: monospace; } /* Literal: Dl, Li, Ql, Bf -literal, Bl -literal, Bl -unfilled. */
 div.mandoc i.addr		{ font-weight: normal; } /* Address (Ad). */
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2014-08-13 15:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201408131525.s7DFPM4r015860@krisdoz.my.domain \
    --to=schwarze@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).