=================================================================== RCS file: /cvs/mandoc/man_html.c,v retrieving revision 1.11 retrieving revision 1.16 diff -u -p -r1.11 -r1.16 --- mandoc/man_html.c 2009/10/18 19:03:36 1.11 +++ mandoc/man_html.c 2009/10/28 08:00:18 1.16 @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.11 2009/10/18 19:03:36 kristaps Exp $ */ +/* $Id: man_html.c,v 1.16 2009/10/28 08:00:18 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -15,7 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include -#include #include #include @@ -30,6 +29,7 @@ #include "main.h" /* TODO: preserve ident widths. */ +/* FIXME: have PD set the default vspace width. */ #define INDENT 5 #define HALFINDENT 3 @@ -104,6 +104,7 @@ static const struct htmlman mans[MAN_MAX] = { { man_RS_pre, NULL }, /* RS */ { man_ign_pre, NULL }, /* DT */ { man_ign_pre, NULL }, /* UC */ + { man_ign_pre, NULL }, /* PD */ }; @@ -178,7 +179,7 @@ print_man_node(MAN_ARGS) struct tag *t; child = 1; - t = SLIST_FIRST(&h->tags); + t = h->tags.head; bufinit(h); @@ -233,7 +234,7 @@ a2width(const struct man_node *n, struct roffsu *su) static int man_root_pre(MAN_ARGS) { - struct htmlpair tag[2]; + struct htmlpair tag[3]; struct tag *t, *tt; char b[BUFSIZ], title[BUFSIZ]; @@ -247,7 +248,9 @@ man_root_pre(MAN_ARGS) PAIR_CLASS_INIT(&tag[0], "header"); bufcat_style(h, "width", "100%"); PAIR_STYLE_INIT(&tag[1], h); - t = print_otag(h, TAG_TABLE, 2, tag); + PAIR_SUMMARY_INIT(&tag[2], "header"); + + t = print_otag(h, TAG_TABLE, 3, tag); tt = print_otag(h, TAG_TR, 0, NULL); bufinit(h); @@ -281,20 +284,18 @@ man_root_pre(MAN_ARGS) static void man_root_post(MAN_ARGS) { - struct tm tm; - struct htmlpair tag[2]; + struct htmlpair tag[3]; struct tag *t, *tt; - char b[BUFSIZ]; + char b[DATESIZ]; - (void)localtime_r(&m->date, &tm); + time2a(m->date, b, DATESIZ); - if (0 == strftime(b, BUFSIZ - 1, "%B %e, %Y", &tm)) - err(EXIT_FAILURE, "strftime"); - PAIR_CLASS_INIT(&tag[0], "footer"); bufcat_style(h, "width", "100%"); PAIR_STYLE_INIT(&tag[1], h); - t = print_otag(h, TAG_TABLE, 2, tag); + PAIR_SUMMARY_INIT(&tag[2], "footer"); + + t = print_otag(h, TAG_TABLE, 3, tag); tt = print_otag(h, TAG_TR, 0, NULL); bufinit(h); @@ -333,6 +334,9 @@ man_br_pre(MAN_ARGS) bufcat_su(h, "height", &su); PAIR_STYLE_INIT(&tag, h); print_otag(h, TAG_DIV, 1, &tag); + /* So the div isn't empty: */ + print_text(h, "\\~"); + return(0); }