=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.124 retrieving revision 1.125 diff -u -p -r1.124 -r1.125 --- mandoc/mdoc_html.c 2010/12/17 01:02:00 1.124 +++ mandoc/mdoc_html.c 2010/12/17 08:17:40 1.125 @@ -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 * @@ -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"); + PAIR_CLASS_INIT(&tag[0], "head"); + PAIR_SUMMARY_INIT(&tag[1], "Document Header"); + 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", "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; }