aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--example.style.css43
-rw-r--r--mdoc_html.c25
2 files changed, 55 insertions, 13 deletions
diff --git a/example.style.css b/example.style.css
index 56f71d40..a75d0197 100644
--- a/example.style.css
+++ b/example.style.css
@@ -1,4 +1,4 @@
-/* $Id: example.style.css,v 1.21 2010/07/26 22:35:59 kristaps Exp $ */
+/* $Id: example.style.css,v 1.22 2010/12/15 15:32:01 kristaps Exp $ */
div.body { font-family: monospace;
min-width: 580px; width: 580px; } /* Top-most div tag. */
@@ -70,3 +70,44 @@ div.symb { font-weight: bold; font-style: normal; } /* Symbols (Bl -symbolic). *
table.footer { } /* Document footer. */
table.header { } /* Document header. */
+
+/* Formatting for lists. */
+
+dl.list-diag { }
+dt.list-diag { }
+dd.list-diag { }
+
+dl.list-hang { }
+dt.list-hang { }
+dd.list-hang { }
+
+dl.list-inset { }
+dt.list-inset { }
+dd.list-inset { }
+
+dl.list-ohang { }
+dt.list-ohang { }
+dd.list-ohang { }
+
+dl.list-tag { }
+dt.list-tag { }
+dd.list-tag { }
+
+table.list-col { }
+tr.list-col { }
+td.list-col { }
+
+ul.list-bul { }
+li.list-bul { }
+
+ul.list-dash { }
+li.list-dash { }
+
+ul.list-hyph { }
+li.list-hyph { }
+
+ul.list-item { }
+li.list-item { }
+
+ol.list-enum { }
+li.list-enum { }
diff --git a/mdoc_html.c b/mdoc_html.c
index 313a82f0..a49598b1 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.115 2010/12/15 14:52:16 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.116 2010/12/15 15:32:01 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -246,13 +246,13 @@ static const struct htmlmdoc mdocs[MDOC_MAX] = {
static const char * const lists[LIST_MAX] = {
NULL,
- "list-bullet",
- "list-column",
+ "list-bul",
+ "list-col",
"list-dash",
"list-diag",
"list-enum",
"list-hang",
- "list-hyphen",
+ "list-hyph",
"list-inset",
"list-item",
"list-ohang",
@@ -903,7 +903,7 @@ mdoc_it_pre(MDOC_ARGS)
{
struct roffsu su;
enum mdoc_list type;
- struct htmlpair tag;
+ struct htmlpair tag[2];
const struct mdoc_node *bl;
bl = n->parent;
@@ -914,11 +914,12 @@ mdoc_it_pre(MDOC_ARGS)
type = bl->data.Bl->type;
- /* Whether we're top-padded (not "compact"). */
+ assert(lists[type]);
+ PAIR_CLASS_INIT(&tag[0], lists[type]);
SCALE_VS_INIT(&su, ! bl->data.Bl->comp);
bufcat_su(h, "margin-top", &su);
- PAIR_STYLE_INIT(&tag, h);
+ PAIR_STYLE_INIT(&tag[1], h);
if (MDOC_HEAD == n->type) {
switch (type) {
@@ -941,7 +942,7 @@ mdoc_it_pre(MDOC_ARGS)
case(LIST_ohang):
/* FALLTHROUGH */
case(LIST_tag):
- print_otag(h, TAG_DT, 1, &tag);
+ print_otag(h, TAG_DT, 2, tag);
break;
case(LIST_column):
break;
@@ -960,7 +961,7 @@ mdoc_it_pre(MDOC_ARGS)
/* FALLTHROUGH */
case(LIST_item):
/* FALLTHROUGH */
- print_otag(h, TAG_LI, 1, &tag);
+ print_otag(h, TAG_LI, 2, tag);
break;
case(LIST_diag):
/* FALLTHROUGH */
@@ -971,10 +972,10 @@ mdoc_it_pre(MDOC_ARGS)
case(LIST_ohang):
/* FALLTHROUGH */
case(LIST_tag):
- print_otag(h, TAG_DD, 0, NULL);
+ print_otag(h, TAG_DD, 1, tag);
break;
case(LIST_column):
- print_otag(h, TAG_TD, 1, &tag);
+ print_otag(h, TAG_TD, 2, tag);
break;
default:
break;
@@ -982,7 +983,7 @@ mdoc_it_pre(MDOC_ARGS)
} else {
switch (type) {
case (LIST_column):
- print_otag(h, TAG_TR, 0, NULL);
+ print_otag(h, TAG_TR, 1, tag);
break;
default:
break;