-
-/* ARGSUSED */
-static int
-mdoc_fl_pre(MDOC_ARGS)
-{
- struct htmlpair tag;
-
- tag.key = ATTR_CLASS;
- tag.val = "flag";
-
- print_otag(h, TAG_SPAN, 1, &tag);
- print_text(h, "\\-");
- h->flags |= HTML_NOSPACE;
- return(1);
-}
-
-
-/* ARGSUSED */
-static int
-mdoc_pp_pre(MDOC_ARGS)
-{
- struct htmlpair tag;
-
- tag.key = ATTR_STYLE;
- tag.val = "clear: both;";
-
- print_otag(h, TAG_BR, 1, &tag);
- print_otag(h, TAG_BR, 1, &tag);
- return(0);
-}
-
-
-/* ARGSUSED */
-static int
-mdoc_nd_pre(MDOC_ARGS)
-{
-
- if (MDOC_BODY == n->type)
- print_text(h, "\\(en");
- return(1);
-}
-
-
-/* ARGSUSED */
-static int
-mdoc_op_pre(MDOC_ARGS)
-{
-
- if (MDOC_BODY == n->type) {
- print_text(h, "\\(lB");
- h->flags |= HTML_NOSPACE;
- }
- return(1);
-}
-
-
-/* ARGSUSED */
-static void
-mdoc_op_post(MDOC_ARGS)
-{
-
- if (MDOC_BODY != n->type)
- return;
- h->flags |= HTML_NOSPACE;
- print_text(h, "\\(rB");
-}
-
-
-static int
-mdoc_nm_pre(MDOC_ARGS)
-{
- struct htmlpair class;
-
- if ( ! (HTML_NEWLINE & h->flags))
- if (SEC_SYNOPSIS == n->sec)
- print_otag(h, TAG_BR, 0, NULL);
-
- class.key = ATTR_CLASS;
- class.val = "name";
-
- print_otag(h, TAG_SPAN, 1, &class);
- if (NULL == n->child)
- print_text(h, m->name);
-
- return(1);
-}
-
-
-/* ARGSUSED */
-static int
-mdoc_sh_pre(MDOC_ARGS)
-{
- struct htmlpair tag;
-
- tag.key = ATTR_CLASS;
- tag.val = "sec";
-
- if (MDOC_BODY == n->type)
- print_otag(h, TAG_DIV, 1, &tag);
- if (MDOC_HEAD == n->type)
- print_otag(h, TAG_SPAN, 1, &tag);
- return(1);
-}
-
-
-/* ARGSUSED */
-static int
-mdoc_xr_pre(MDOC_ARGS)
-{
- struct htmlpair tag;
-
- tag.key = ATTR_HREF;
- tag.val = "#"; /* TODO */
-
- print_otag(h, TAG_A, 1, &tag);
-
- n = n->child;
- print_text(h, n->string);
- if (NULL == (n = n->next))
- return(0);
-
- h->flags |= HTML_NOSPACE;
- print_text(h, "(");
- h->flags |= HTML_NOSPACE;
- print_text(h, n->string);
- h->flags |= HTML_NOSPACE;
- print_text(h, ")");
-
- return(0);
-}
-
-
-/* ARGSUSED */
-static int
-mdoc_ns_pre(MDOC_ARGS)
-{
-
- h->flags |= HTML_NOSPACE;
- return(1);
-}
-
-/* ARGSUSED */
-static int
-mdoc_ar_pre(MDOC_ARGS)
-{
- struct htmlpair tag;
-
- tag.key = ATTR_CLASS;
- tag.val = "arg";
-
- print_otag(h, TAG_SPAN, 1, &tag);
- return(1);
-}
-
-/* ARGSUSED */
-static int
-mdoc_xx_pre(MDOC_ARGS)
-{
- const char *pp;
-
- switch (n->tok) {
- case (MDOC_Bsx):
- pp = "BSDI BSD/OS";
- break;
- case (MDOC_Dx):
- pp = "DragonFlyBSD";
- break;
- case (MDOC_Fx):
- pp = "FreeBSD";
- break;
- case (MDOC_Nx):
- pp = "NetBSD";
- break;
- case (MDOC_Ox):
- pp = "OpenBSD";
- break;
- case (MDOC_Ux):
- pp = "UNIX";
- break;
- default:
- return(1);
- }
-
- print_text(h, pp);
- return(1);
-}
-
-
-static int
-mdoc_tbl_block_pre(MDOC_ARGS, int w, int o, int c)
-{
- struct htmlpair tag;
- char buf[BUFSIZ];
-
- buf[BUFSIZ - 1] = 0;
-
- snprintf(buf, BUFSIZ - 1, "margin-left: %dpx; "
- "clear: both;", w + o);
-
- if ( ! c)
- (void)strlcat(buf, " padding-top: 1em;", BUFSIZ);
-
- tag.key = ATTR_STYLE;
- tag.val = buf;
-
- print_otag(h, TAG_DIV, 1, &tag);
- return(1);
-}
-
-
-static int
-mdoc_tbl_body_pre(MDOC_ARGS, int t, int w)
-{
- struct htmlpair tag;
- char buf[BUFSIZ];
- int i;
-
- buf[BUFSIZ - 1] = 0;
- i = 0;
-
- switch (t) {
- case (MDOC_Tag):
- i++;
- (void)snprintf(buf, BUFSIZ - 1,
- "clear: right; float: left; "
- "width: 100%%;");
- tag.key = ATTR_STYLE;
- tag.val = buf;
- break;
- default:
- break;
- }
-
- print_otag(h, TAG_DIV, i, &tag);
- return(1);
-}
-
-
-static int
-mdoc_tbl_head_pre(MDOC_ARGS, int type, int w)
-{
- struct htmlpair tag;
- char buf[BUFSIZ];
- int i;
-
- buf[BUFSIZ - 1] = 0;
- i = 0;
-
- switch (type) {
- case (MDOC_Tag):
- i++;
- (void)snprintf(buf, BUFSIZ - 1,
- "clear: left; float: left; "
- "padding-right: 1em; "
- "margin-left: -%dpx;", w);
- tag.key = ATTR_STYLE;
- tag.val = buf;
- break;
- default:
- i++;
- (void)snprintf(buf, BUFSIZ - 1,
- "clear: left; float: left; "
- "margin-left: -%dpx; "
- "padding-right: 1em;", w);
- tag.key = ATTR_STYLE;
- tag.val = buf;
- break;
- }
-
- print_otag(h, TAG_DIV, i, &tag);
- return(1);
-}
-
-
-static int
-mdoc_tbl_pre(MDOC_ARGS, int type)