aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--example.style.css13
-rw-r--r--html.c6
-rw-r--r--mdoc_html.c66
3 files changed, 38 insertions, 47 deletions
diff --git a/example.style.css b/example.style.css
index 38890bfc..50d6668d 100644
--- a/example.style.css
+++ b/example.style.css
@@ -1,12 +1,17 @@
-/* $Id: example.style.css,v 1.29 2010/12/17 01:02:00 kristaps Exp $ */
+/* $Id: example.style.css,v 1.30 2010/12/17 08:17:40 kristaps Exp $ */
html { min-width: 580px; width: 580px; }
body { font-family: monospace; }
/* Preamble structure. */
-table.footer { } /* Document footer. */
-table.header { } /* Document header. */
+table.foot { width: 100%; } /* Document footer. */
+td.foot-date { width: 50%; } /* Document footer: date. */
+td.foot-os { width: 50%; text-align: right; } /* Document footer: OS. */
+table.head { width: 100%; } /* Document header. */
+td.head-ltitle { width: 10%; } /* Document header: left-title. */
+td.head-vol { width: 80%; text-align: center; } /* Document header: volume. */
+td.head-rtitle { width: 10%; text-align: right; } /* Document header: right-title. */
/* Sections. */
@@ -20,6 +25,8 @@ table.synopsis td { vertical-align: top; } /* SYNOPSIS section table. */
/* Vertical spacing. */
p { } /* Paragraph: Pp, Lp. */
+blockquote { margin-top: 0px; margin-bottom: 0px; }
+table { margin-top: 0px; margin-bottom: 0px; }
/* General font modes. */
diff --git a/html.c b/html.c
index 60839960..8d5d4793 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.116 2010/12/15 17:19:41 kristaps Exp $ */
+/* $Id: html.c,v 1.117 2010/12/17 08:17:40 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -449,6 +449,10 @@ print_otag(struct html *h, enum htmltag tag,
putchar('>');
h->flags |= HTML_NOSPACE;
+
+ if ((HTML_AUTOCLOSE | HTML_CLRLINE) & htmltags[tag].flags)
+ putchar('\n');
+
return(t);
}
diff --git a/mdoc_html.c b/mdoc_html.c
index 15c1cc7a..8d5c00c7 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.124 2010/12/17 01:02:00 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.125 2010/12/17 08:17:40 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -299,21 +299,15 @@ a2width(const char *p, struct roffsu *su)
static void
synopsis_pre(struct html *h, const struct mdoc_node *n)
{
- struct roffsu su;
- struct htmlpair tag;
if (NULL == n->prev || ! (MDOC_SYNPRETTY & n->flags))
return;
- SCALE_VS_INIT(&su, 1);
- bufcat_su(h, "margin-top", &su);
- PAIR_STYLE_INIT(&tag, h);
-
if (n->prev->tok == n->tok &&
MDOC_Fo != n->tok &&
MDOC_Ft != n->tok &&
MDOC_Fn != n->tok) {
- print_otag(h, TAG_DIV, 0, NULL);
+ print_otag(h, TAG_BR, 0, NULL);
return;
}
@@ -327,16 +321,16 @@ synopsis_pre(struct html *h, const struct mdoc_node *n)
case (MDOC_In):
/* FALLTHROUGH */
case (MDOC_Vt):
- print_otag(h, TAG_DIV, 1, &tag);
+ print_otag(h, TAG_P, 0, NULL);
break;
case (MDOC_Ft):
if (MDOC_Fn != n->tok && MDOC_Fo != n->tok) {
- print_otag(h, TAG_DIV, 1, &tag);
+ print_otag(h, TAG_P, 0, NULL);
break;
}
/* FALLTHROUGH */
default:
- print_otag(h, TAG_DIV, 0, NULL);
+ print_otag(h, TAG_BR, 0, NULL);
break;
}
}
@@ -463,37 +457,31 @@ print_mdoc_node(MDOC_ARGS)
}
}
-
/* ARGSUSED */
static void
mdoc_root_post(MDOC_ARGS)
{
- struct htmlpair tag[3];
+ struct htmlpair tag[2];
struct tag *t, *tt;
char b[DATESIZ];
time2a(m->date, b, DATESIZ);
- PAIR_CLASS_INIT(&tag[0], "footer");
- bufcat_style(h, "width", "100%");
- PAIR_STYLE_INIT(&tag[1], h);
- PAIR_SUMMARY_INIT(&tag[2], "footer");
+ PAIR_CLASS_INIT(&tag[0], "foot");
+ PAIR_SUMMARY_INIT(&tag[1], "Document Footer");
+ t = print_otag(h, TAG_TABLE, 2, tag);
- t = print_otag(h, TAG_TABLE, 3, tag);
tt = print_otag(h, TAG_TR, 0, NULL);
- bufinit(h);
- bufcat_style(h, "width", "50%");
- PAIR_STYLE_INIT(&tag[0], h);
+ PAIR_CLASS_INIT(&tag[0], "foot-date");
print_otag(h, TAG_TD, 1, tag);
+
print_text(h, b);
print_stagq(h, tt);
- bufinit(h);
- bufcat_style(h, "width", "50%");
- bufcat_style(h, "text-align", "right");
- PAIR_STYLE_INIT(&tag[0], h);
+ PAIR_CLASS_INIT(&tag[0], "foot-os");
print_otag(h, TAG_TD, 1, tag);
+
print_text(h, m->os);
print_tagq(h, t);
}
@@ -517,36 +505,27 @@ mdoc_root_pre(MDOC_ARGS)
snprintf(title, BUFSIZ - 1, "%s(%s)", m->title, m->msec);
- PAIR_CLASS_INIT(&tag[0], "header");
- bufcat_style(h, "width", "100%");
- PAIR_STYLE_INIT(&tag[1], h);
- PAIR_SUMMARY_INIT(&tag[2], "header");
-
- t = print_otag(h, TAG_TABLE, 3, tag);
+ PAIR_CLASS_INIT(&tag[0], "head");
+ PAIR_SUMMARY_INIT(&tag[1], "Document Header");
+ t = print_otag(h, TAG_TABLE, 2, tag);
tt = print_otag(h, TAG_TR, 0, NULL);
- bufinit(h);
- bufcat_style(h, "width", "10%");
- PAIR_STYLE_INIT(&tag[0], h);
+ PAIR_CLASS_INIT(&tag[0], "head-ltitle");
print_otag(h, TAG_TD, 1, tag);
+
print_text(h, title);
print_stagq(h, tt);
- bufinit(h);
- bufcat_style(h, "text-align", "center");
- bufcat_style(h, "white-space", "nowrap");
- bufcat_style(h, "width", "80%");
- PAIR_STYLE_INIT(&tag[0], h);
+ PAIR_CLASS_INIT(&tag[0], "head-vol");
print_otag(h, TAG_TD, 1, tag);
+
print_text(h, b);
print_stagq(h, tt);
- bufinit(h);
- bufcat_style(h, "text-align", "right");
- bufcat_style(h, "width", "10%");
- PAIR_STYLE_INIT(&tag[0], h);
+ PAIR_CLASS_INIT(&tag[0], "head-rtitle");
print_otag(h, TAG_TD, 1, tag);
+
print_text(h, title);
print_tagq(h, t);
return(1);
@@ -1196,6 +1175,7 @@ mdoc_bd_pre(MDOC_ARGS)
}
if (nn->next && nn->next->line == nn->line)
continue;
+
print_text(h, "\n");
h->flags |= HTML_NOSPACE;
}