aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-08-13 15:25:22 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-08-13 15:25:22 +0000
commit08b7f86267663883d71e98c502652ec334c232bc (patch)
tree0abce60889668c8d52f51d9f27148ca85a77beec
parentfaf800341f0f487ab0edd954fb2a6e0eddb2db96 (diff)
downloadmandoc-08b7f86267663883d71e98c502652ec334c232bc.tar.gz
mandoc-08b7f86267663883d71e98c502652ec334c232bc.tar.zst
mandoc-08b7f86267663883d71e98c502652ec334c232bc.zip
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@
-rw-r--r--example.style.css4
-rw-r--r--html.c3
-rw-r--r--html.h3
-rw-r--r--mdoc_html.c12
-rw-r--r--style.css4
5 files changed, 13 insertions, 13 deletions
diff --git a/example.style.css b/example.style.css
index 660f4d13..e17af922 100644
--- a/example.style.css
+++ b/example.style.css
@@ -1,4 +1,4 @@
-/* $Id: example.style.css,v 1.49 2011/12/15 12:18:57 kristaps Exp $ */
+/* $Id: example.style.css,v 1.50 2014/08/13 15:25:22 schwarze Exp $ */
/*
* This is an example style-sheet provided for mandoc(1) and the -Thtml
* or -Txhtml output mode.
@@ -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). */
diff --git a/html.c b/html.c
index e7da3ad3..0fd6f04d 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.160 2014/08/10 23:54:41 schwarze Exp $ */
+/* $Id: html.c,v 1.161 2014/08/13 15:25:22 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -74,6 +74,7 @@ static const struct htmldata htmltags[TAG_MAX] = {
{"i", 0 }, /* TAG_I */
{"code", 0 }, /* TAG_CODE */
{"small", 0 }, /* TAG_SMALL */
+ {"em", 0 }, /* TAG_EM */
};
static const char *const htmlattrs[ATTR_MAX] = {
diff --git a/html.h b/html.h
index ca15f0f3..d2b3a212 100644
--- a/html.h
+++ b/html.h
@@ -1,4 +1,4 @@
-/* $Id: html.h,v 1.51 2014/04/20 16:46:04 schwarze Exp $ */
+/* $Id: html.h,v 1.52 2014/08/13 15:25:22 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -50,6 +50,7 @@ enum htmltag {
TAG_I,
TAG_CODE,
TAG_SMALL,
+ TAG_EM,
TAG_MAX
};
diff --git a/mdoc_html.c b/mdoc_html.c
index 61a2d76c..a94d0c01 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.196 2014/08/10 23:54:41 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.197 2014/08/13 15:25:22 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);
}
diff --git a/style.css b/style.css
index ee891f41..ba0d33df 100644
--- a/style.css
+++ b/style.css
@@ -1,4 +1,4 @@
-/* $Id: style.css,v 1.25 2011/08/26 09:03:17 kristaps Exp $ */
+/* $Id: style.css,v 1.26 2014/08/13 15:25:22 schwarze Exp $ */
/*
* This is an example style-sheet provided for mandoc(1) and the -Thtml
@@ -34,7 +34,7 @@ td.head-rtitle { width: 10%; text-align: right; } /* Document header: right-titl
/* 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. */