summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-12-20 13:39:24 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-12-20 13:39:24 +0000
commit1d20bdcb6e7b96af2ef002ef093c35d4e483fee1 (patch)
tree48cc4e0623b31f709b26439795b3c3c3106db104
parent0ea097c0d8b188de2567ac57aadf0367b0862a73 (diff)
downloadmandoc-1d20bdcb6e7b96af2ef002ef093c35d4e483fee1.tar.gz
Fix list-type being clobbered by margins. Last default styles in place.
Added `Sx' to be default-italic (as in OpenBSD's cvsweb). Added `diag' formatting, which had been lost.
-rw-r--r--example.style.css5
-rw-r--r--mdoc_html.c25
-rw-r--r--style.css38
3 files changed, 35 insertions, 33 deletions
diff --git a/example.style.css b/example.style.css
index a9bfb7f1..ddcd21c1 100644
--- a/example.style.css
+++ b/example.style.css
@@ -57,7 +57,7 @@ b.cmd { font-style: normal; } /* Command (Cm). */
b.config { font-style: normal; } /* Config statement (Cd). */
span.define { } /* Defines (Dv). */
span.desc { } /* Nd. After em-dash. */
-span.diag { font-style: normal; font-weight: bold; } /* Diagnostic (Bl -diag). */
+b.diag { font-style: normal; } /* Diagnostic (Bl -diag). */
span.env { } /* Environment variables (Ev). */
span.errno { } /* Error string (Er). */
i.farg { font-weight: normal; } /* Function argument (Fa, Fn). */
@@ -67,6 +67,7 @@ b.fname { font-style: normal; } /* Function name (Fa, Fn, Rv). */
i.ftype { font-weight: normal; } /* Function types (Ft, Fn). */
b.includes { font-style: normal; } /* Header includes (In). */
span.lib { } /* Library (Lb). */
+i.link-sec { font-weight: normal; } /* Section links (Sx). */
b.macro { font-style: normal; } /* Macro-ish thing (Fd). */
b.name { font-style: normal; } /* Name of utility (Nm). */
span.opt { } /* Options (Op, Oo/Oc). */
@@ -94,7 +95,7 @@ a.link-includes { } /* Include-file link (In). */
a.link-mail { } /* Mailto links (Mt). */
a.link-man { } /* Manual links (Xr). */
a.link-ref { } /* Reference section links (%Q). */
-a.link-sec { font-style: italic; font-weight: normal; } /* Section links (Sx). */
+a.link-sec { } /* Section links (Sx). */
/* Formatting for lists. */
diff --git a/mdoc_html.c b/mdoc_html.c
index 8f6502b1..fbfcf002 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -857,7 +857,6 @@ mdoc_it_pre(MDOC_ARGS)
case(LIST_enum):
return(0);
case(LIST_diag):
- /* FIXME: STYLE for diag! */
/* FALLTHROUGH */
case(LIST_hang):
/* FALLTHROUGH */
@@ -870,6 +869,10 @@ mdoc_it_pre(MDOC_ARGS)
bufcat_su(h, "margin-top", &su);
PAIR_STYLE_INIT(&tag[1], h);
print_otag(h, TAG_DT, 2, tag);
+ if (LIST_diag != type)
+ break;
+ PAIR_CLASS_INIT(&tag[0], "diag");
+ print_otag(h, TAG_B, 1, tag);
break;
case(LIST_column):
break;
@@ -939,6 +942,7 @@ mdoc_bl_pre(MDOC_ARGS)
size_t i;
struct htmlpair tag[3];
struct roffsu su;
+ char buf[BUFSIZ];
if (MDOC_BODY == n->type) {
if (LIST_column == n->data.Bl->type)
@@ -977,19 +981,15 @@ mdoc_bl_pre(MDOC_ARGS)
PAIR_STYLE_INIT(&tag[0], h);
assert(lists[n->data.Bl->type]);
- bufinit(h);
- bufcat(h, "list ");
- bufcat(h, lists[n->data.Bl->type]);
- PAIR_INIT(&tag[1], ATTR_CLASS, h->buf);
- i = 2;
+ strlcpy(buf, "list ", BUFSIZ);
+ strlcat(buf, lists[n->data.Bl->type], BUFSIZ);
+ PAIR_INIT(&tag[1], ATTR_CLASS, buf);
/* Set the block's left-hand margin. */
if (n->data.Bl->offs) {
a2offs(n->data.Bl->offs, &su);
bufcat_su(h, "margin-left", &su);
- PAIR_STYLE_INIT(&tag[2], h);
- i = 3;
}
switch (n->data.Bl->type) {
@@ -1000,10 +1000,10 @@ mdoc_bl_pre(MDOC_ARGS)
case(LIST_hyphen):
/* FALLTHROUGH */
case(LIST_item):
- print_otag(h, TAG_UL, i, tag);
+ print_otag(h, TAG_UL, 2, tag);
break;
case(LIST_enum):
- print_otag(h, TAG_OL, i, tag);
+ print_otag(h, TAG_OL, 2, tag);
break;
case(LIST_diag):
/* FALLTHROUGH */
@@ -1014,10 +1014,10 @@ mdoc_bl_pre(MDOC_ARGS)
case(LIST_ohang):
/* FALLTHROUGH */
case(LIST_tag):
- print_otag(h, TAG_DL, i, tag);
+ print_otag(h, TAG_DL, 2, tag);
break;
case(LIST_column):
- print_otag(h, TAG_TABLE, i, tag);
+ print_otag(h, TAG_TABLE, 2, tag);
break;
default:
abort();
@@ -1124,6 +1124,7 @@ mdoc_sx_pre(MDOC_ARGS)
PAIR_CLASS_INIT(&tag[0], "link-sec");
PAIR_HREF_INIT(&tag[1], buf);
+ print_otag(h, TAG_I, 1, tag);
print_otag(h, TAG_A, 2, tag);
return(1);
}
diff --git a/style.css b/style.css
index 0a0a4d0b..97ab0470 100644
--- a/style.css
+++ b/style.css
@@ -57,44 +57,44 @@ table { margin-top: 0px; margin-bottom: 0px; }
/* Context-specific modes. */
-span.addr { font-style: italic; font-weight: normal; } /* Address (Ad). */
-span.arg { font-style: italic; font-weight: normal; } /* Command argument (Ar). */
+i.addr { font-weight: normal; } /* Address (Ad). */
+i.arg { font-weight: normal; } /* Command argument (Ar). */
span.author { } /* Author name (An). */
-span.cmd { font-style: normal; font-weight: bold; } /* Command (Cm). */
-span.config { font-style: normal; font-weight: bold; } /* Config statement (Cd). */
+b.cmd { font-style: normal; } /* Command (Cm). */
+b.config { font-style: normal; } /* Config statement (Cd). */
span.define { } /* Defines (Dv). */
span.desc { } /* Nd. After em-dash. */
-span.diag { font-style: normal; font-weight: bold; } /* Diagnostic (Bl -diag). */
+b.diag { font-style: normal; } /* Diagnostic (Bl -diag). */
span.env { } /* Environment variables (Ev). */
span.errno { } /* Error string (Er). */
-span.farg { font-style: italic; font-weight: normal; } /* Function argument (Fa, Fn). */
-span.file { font-style: italic; font-weight: normal; } /* File (Pa). */
-span.flag { font-style: normal; font-weight: bold; } /* Flag (Fl, Cm). */
-span.fname { font-style: normal; font-weight: bold; } /* Function name (Fa, Fn, Rv). */
-span.ftype { font-style: italic; font-weight: normal; } /* Function types (Ft, Fn). */
-span.includes { font-style: normal; font-weight: bold; } /* Header includes (In). */
+i.farg { font-weight: normal; } /* Function argument (Fa, Fn). */
+i.file { font-weight: normal; } /* File (Pa). */
+b.flag { font-style: normal; } /* Flag (Fl, Cm). */
+b.fname { font-style: normal; } /* Function name (Fa, Fn, Rv). */
+i.ftype { font-weight: normal; } /* Function types (Ft, Fn). */
+b.includes { font-style: normal; } /* Header includes (In). */
span.lib { } /* Library (Lb). */
-span.macro { font-style: normal; font-weight: bold; } /* Macro-ish thing (Fd). */
-span.name { color: blue; font-style: normal; font-weight: bold; } /* Name of utility (Nm). */
+b.macro { font-style: normal; } /* Macro-ish thing (Fd). */
+b.name { color: blue; font-style: normal; } /* Name of utility (Nm). */
span.opt { } /* Options (Op, Oo/Oc). */
span.ref { } /* Citations (Rs). */
span.ref-auth { } /* Reference author (%A). */
-span.ref-book { font-style: italic; font-weight: normal; } /* Reference book (%B). */
+i.ref-book { font-weight: normal; } /* Reference book (%B). */
span.ref-city { } /* Reference city (%C). */
span.ref-date { } /* Reference date (%D). */
-span.ref-issue { font-style: italic; font-weight: normal; } /* Reference issuer/publisher (%I). */
-span.ref-jrnl { font-style: italic; font-weight: normal; } /* Reference journal (%J). */
+i.ref-issue { font-weight: normal; } /* Reference issuer/publisher (%I). */
+i.ref-jrnl { font-weight: normal; } /* Reference journal (%J). */
span.ref-num { } /* Reference number (%N). */
span.ref-opt { } /* Reference optionals (%O). */
span.ref-page { } /* Reference page (%P). */
span.ref-corp { } /* Reference corporate/foreign author (%Q). */
span.ref-rep { } /* Reference report (%R). */
-span.ref-title { text-decoration: underline; } /* Reference title (%T). */
+u.ref-title { } /* Reference title (%T). */
span.ref-vol { } /* Reference volume (%V). */
span.type { font-style: italic; font-weight: normal; } /* Variable types (Vt). */
span.unix { } /* Unices (Ux, Ox, Nx, Fx, Bx, Bsx, Dx). */
-span.utility { font-style: normal; font-weight: bold; } /* Name of utility (Ex). */
-span.var { font-style: normal; font-weight: bold; } /* Variables (Rv). */
+b.utility { font-style: normal; } /* Name of utility (Ex). */
+b.var { font-style: normal; } /* Variables (Rv). */
a.link-ext { background: transparent url(external.png) center right no-repeat; padding-right: 12px; }/* Off-site link (Lk). */
a.link-includes { } /* Include-file link (In). */