=================================================================== RCS file: /cvs/mandoc/man_html.c,v retrieving revision 1.79 retrieving revision 1.82 diff -u -p -r1.79 -r1.82 --- mandoc/man_html.c 2011/07/21 11:34:53 1.79 +++ mandoc/man_html.c 2011/10/05 21:35:17 1.82 @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.79 2011/07/21 11:34:53 kristaps Exp $ */ +/* $Id: man_html.c,v 1.82 2011/10/05 21:35:17 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * @@ -36,7 +36,6 @@ /* FIXME: have PD set the default vspace width. */ #define INDENT 5 -#define HALFINDENT 3 #define MAN_ARGS const struct man_meta *m, \ const struct man_node *n, \ @@ -142,33 +141,32 @@ print_bvspace(struct html *h, const struct man_node *n void html_man(void *arg, const struct man *m) { - struct html *h; - struct tag *t; struct mhtml mh; - h = (struct html *)arg; - - print_gen_decls(h); - memset(&mh, 0, sizeof(struct mhtml)); - - t = print_otag(h, TAG_HTML, 0, NULL); - print_man(man_meta(m), man_node(m), &mh, h); - print_tagq(h, t); - - printf("\n"); + print_man(man_meta(m), man_node(m), &mh, (struct html *)arg); + putchar('\n'); } static void print_man(MAN_ARGS) { - struct tag *t; + struct tag *t, *tt; + struct htmlpair tag; - t = print_otag(h, TAG_HEAD, 0, NULL); - print_man_head(m, n, mh, h); - print_tagq(h, t); + PAIR_CLASS_INIT(&tag, "mandoc"); - t = print_otag(h, TAG_BODY, 0, NULL); + if ( ! (HTML_FRAGMENT & h->oflags)) { + print_gen_decls(h); + t = print_otag(h, TAG_HTML, 0, NULL); + tt = print_otag(h, TAG_HEAD, 0, NULL); + print_man_head(m, n, mh, h); + print_tagq(h, tt); + print_otag(h, TAG_BODY, 0, NULL); + print_otag(h, TAG_DIV, 1, &tag); + } else + t = print_otag(h, TAG_DIV, 1, &tag); + print_man_nodelist(m, n, mh, h); print_tagq(h, t); } @@ -201,7 +199,6 @@ print_man_node(MAN_ARGS) { int child; struct tag *t; - struct htmlpair tag; child = 1; t = h->tags.head; @@ -229,9 +226,7 @@ print_man_node(MAN_ARGS) print_text(h, n->string); return; case (MAN_EQN): - PAIR_CLASS_INIT(&tag, "eqn"); - /*print_otag(h, TAG_SPAN, 1, &tag); - print_text(h, n->eqn->data);*/ + print_eqn(h, n->eqn); break; case (MAN_TBL): /*