summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_html.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2011-10-09 17:59:56 +0000
committerschwarze <schwarze@openbsd.org>2011-10-09 17:59:56 +0000
commitca0ce6762974606a4933de316ab207259ea4a395 (patch)
tree812972b723e18e7b8ce12355e7688f24cbe79ae8 /usr.bin/mandoc/man_html.c
parentPad the ECOFF output file to a 512 bytes boundary; older AViiON firmware will (diff)
downloadwireguard-openbsd-ca0ce6762974606a4933de316ab207259ea4a395.tar.xz
wireguard-openbsd-ca0ce6762974606a4933de316ab207259ea4a395.zip
Sync to version 1.12.0; all code by kristaps@:
Implement .Rv in -Tman. Let -man -Tman work a bit like cat(1). Add the -Ofragment option to -T[x]html. Minor fixes in -T[x]html. Lots of apropos(1) and -Tman code cleanup.
Diffstat (limited to 'usr.bin/mandoc/man_html.c')
-rw-r--r--usr.bin/mandoc/man_html.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c
index 5192ba9761e..0e44a8074bf 100644
--- a/usr.bin/mandoc/man_html.c
+++ b/usr.bin/mandoc/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.42 2011/09/18 15:54:48 schwarze Exp $ */
+/* $Id: man_html.c,v 1.43 2011/10/09 17:59:56 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -137,33 +137,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);
}