summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2018-05-08 17:52:25 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2018-05-08 17:52:25 +0000
commit5841f62ce7778f2208ee94b7e3b6162584623636 (patch)
tree4b1de15e74e938113217236445149a471d3b8bfa /usr.bin
parent91fb5dd5637b1a232049f9a66202c85ab4242de6 (diff)
Switch the emitted HTML element from <b> to <code> for the fixed
syntax element macros .Nm, .Fl, .Cm, .Ic, .In, .Fd, .Fn, and .Cd. Adjust both the internal and external style sheets such that rendering remains unchanged in typical browsers. Based on feedback from John Gardner <gardnerjohng at gmail dot com>.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/html.c8
-rw-r--r--usr.bin/mandoc/mandoc.css34
-rw-r--r--usr.bin/mandoc/mdoc_html.c22
3 files changed, 43 insertions, 21 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c
index 8dd4040ded3..5a036a07285 100644
--- a/usr.bin/mandoc/html.c
+++ b/usr.bin/mandoc/html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: html.c,v 1.92 2018/05/01 23:36:39 schwarze Exp $ */
+/* $OpenBSD: html.c,v 1.93 2018/05/08 17:52:24 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -184,6 +184,12 @@ print_gen_head(struct html *h)
print_text(h, "td.head-vol { text-align: center; }");
print_endline(h);
print_text(h, "div.Pp { margin: 1ex 0ex; }");
+ print_endline(h);
+ print_text(h, "code.Nm, code.Fl, code.Cm, code.Ic, "
+ "code.In, code.Fd, code.Fn,");
+ print_endline(h);
+ print_text(h, "code.Cd { font-weight: bold; "
+ "font-family: inherit; }");
print_tagq(h, t);
}
diff --git a/usr.bin/mandoc/mandoc.css b/usr.bin/mandoc/mandoc.css
index 8d192ab91a0..ba13134d86d 100644
--- a/usr.bin/mandoc/mandoc.css
+++ b/usr.bin/mandoc/mandoc.css
@@ -1,4 +1,4 @@
-/* $OpenBSD: mandoc.css,v 1.10 2018/04/24 00:36:04 schwarze Exp $ */
+/* $OpenBSD: mandoc.css,v 1.11 2018/05/08 17:52:24 schwarze Exp $ */
/*
* Standard style sheet for mandoc(1) -Thtml and man.cgi(8).
*/
@@ -145,13 +145,21 @@ table.tbl { }
/* Semantic markup for command line utilities. */
table.Nm { }
-b.Nm { font-style: normal; }
-b.Fl { font-style: normal; }
-b.Cm { font-style: normal; }
+code.Nm { font-style: normal;
+ font-weight: bold;
+ font-family: inherit; }
+code.Fl { font-style: normal;
+ font-weight: bold;
+ font-family: inherit; }
+code.Cm { font-style: normal;
+ font-weight: bold;
+ font-family: inherit; }
var.Ar { font-style: italic;
font-weight: normal; }
span.Op { }
-b.Ic { font-style: normal; }
+code.Ic { font-style: normal;
+ font-weight: bold;
+ font-family: inherit; }
code.Ev { font-style: normal;
font-weight: normal;
font-family: monospace; }
@@ -160,12 +168,18 @@ i.Pa { font-weight: normal; }
/* Semantic markup for function libraries. */
span.Lb { }
-b.In { font-style: normal; }
+code.In { font-style: normal;
+ font-weight: bold;
+ font-family: inherit; }
a.In { }
-b.Fd { font-style: normal; }
+code.Fd { font-style: normal;
+ font-weight: bold;
+ font-family: inherit; }
var.Ft { font-style: italic;
font-weight: normal; }
-b.Fn { font-style: normal; }
+code.Fn { font-style: normal;
+ font-weight: bold;
+ font-family: inherit; }
var.Fa { font-style: italic;
font-weight: normal; }
var.Vt { font-style: italic;
@@ -184,7 +198,9 @@ code.Er { font-style: normal;
span.An { }
a.Lk { }
a.Mt { }
-b.Cd { font-style: normal; }
+code.Cd { font-style: normal;
+ font-weight: bold;
+ font-family: inherit; }
i.Ad { font-weight: normal; }
b.Ms { font-style: normal; }
span.St { }
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index 9e76eb43888..99ddac9628d 100644
--- a/usr.bin/mandoc/mdoc_html.c
+++ b/usr.bin/mandoc/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_html.c,v 1.172 2018/04/24 00:36:04 schwarze Exp $ */
+/* $OpenBSD: mdoc_html.c,v 1.173 2018/05/08 17:52:24 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -550,7 +550,7 @@ mdoc_fl_pre(MDOC_ARGS)
if ((id = cond_id(n)) != NULL)
print_otag(h, TAG_A, "chR", "permalink", id);
- print_otag(h, TAG_B, "cTi", "Fl", id);
+ print_otag(h, TAG_CODE, "cTi", "Fl", id);
free(id);
print_text(h, "\\-");
@@ -570,7 +570,7 @@ mdoc_cm_pre(MDOC_ARGS)
if ((id = cond_id(n)) != NULL)
print_otag(h, TAG_A, "chR", "permalink", id);
- print_otag(h, TAG_B, "cTi", "Cm", id);
+ print_otag(h, TAG_CODE, "cTi", "Cm", id);
free(id);
return 1;
}
@@ -596,7 +596,7 @@ mdoc_nm_pre(MDOC_ARGS)
print_otag(h, TAG_TD, "");
/* FALLTHROUGH */
case ROFFT_ELEM:
- print_otag(h, TAG_B, "cT", "Nm");
+ print_otag(h, TAG_CODE, "cT", "Nm");
return 1;
case ROFFT_BODY:
print_otag(h, TAG_TD, "");
@@ -1058,7 +1058,7 @@ static int
mdoc_cd_pre(MDOC_ARGS)
{
synopsis_pre(h, n);
- print_otag(h, TAG_B, "cT", "Cd");
+ print_otag(h, TAG_CODE, "cT", "Cd");
return 1;
}
@@ -1147,11 +1147,11 @@ mdoc_fd_pre(MDOC_ARGS)
assert(n->type == ROFFT_TEXT);
if (strcmp(n->string, "#include")) {
- print_otag(h, TAG_B, "cT", "Fd");
+ print_otag(h, TAG_CODE, "cT", "Fd");
return 1;
}
- print_otag(h, TAG_B, "cT", "In");
+ print_otag(h, TAG_CODE, "cT", "In");
print_text(h, n->string);
if (NULL != (n = n->next)) {
@@ -1237,7 +1237,7 @@ mdoc_fn_pre(MDOC_ARGS)
print_tagq(h, t);
}
- t = print_otag(h, TAG_B, "cT", "Fn");
+ t = print_otag(h, TAG_CODE, "cT", "Fn");
if (sp)
print_text(h, sp);
@@ -1380,7 +1380,7 @@ mdoc_fo_pre(MDOC_ARGS)
return 0;
assert(n->child->string);
- t = print_otag(h, TAG_B, "cT", "Fn");
+ t = print_otag(h, TAG_CODE, "cT", "Fn");
print_text(h, n->child->string);
print_tagq(h, t);
return 0;
@@ -1404,7 +1404,7 @@ mdoc_in_pre(MDOC_ARGS)
struct tag *t;
synopsis_pre(h, n);
- print_otag(h, TAG_B, "cT", "In");
+ print_otag(h, TAG_CODE, "cT", "In");
/*
* The first argument of the `In' gets special treatment as
@@ -1450,7 +1450,7 @@ mdoc_ic_pre(MDOC_ARGS)
if ((id = cond_id(n)) != NULL)
print_otag(h, TAG_A, "chR", "permalink", id);
- print_otag(h, TAG_B, "cTi", "Ic", id);
+ print_otag(h, TAG_CODE, "cTi", "Ic", id);
free(id);
return 1;
}