summaryrefslogtreecommitdiffstats
path: root/man_html.c
diff options
context:
space:
mode:
Diffstat (limited to 'man_html.c')
-rw-r--r--man_html.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/man_html.c b/man_html.c
index 681cd9df..050bc84a 100644
--- a/man_html.c
+++ b/man_html.c
@@ -141,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");
+
+ 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);
- t = print_otag(h, TAG_BODY, 0, NULL);
print_man_nodelist(m, n, mh, h);
print_tagq(h, t);
}