- (void)snprintf(title, sizeof(title), "%s (%s)",
- roff_volname(bvol), roff_volname(vol));
- } else
- (void)snprintf(title, sizeof(title), "%s", roff_volname(vol));
-
-
- i = 0;
-
- if ( ! html_typeput(mbuf, HTML_TYPE_4_01_STRICT, NULL))
- return(0);
- if ( ! html_tputln(mbuf, ML_OPEN, i, HTML_TAG_HTML))
- return(0);
- if ( ! html_tputln(mbuf, ML_OPEN, i++, HTML_TAG_HEAD))
- return(0);
-
- attr[0].attr = HTML_ATTR_HTTP_EQUIV;
- attr[0].val = "content-type";
- attr[1].attr = HTML_ATTR_CONTENT;
- attr[1].val = "text/html;charset=utf-8";
-
- if ( ! html_aputln(mbuf, ML_OPEN, i, HTML_TAG_META, 2, attr))
- return(0);
-
- attr[0].attr = HTML_ATTR_NAME;
- attr[0].val = "resource-type";
- attr[1].attr = HTML_ATTR_CONTENT;
- attr[1].val = "document";
-
- if ( ! html_aputln(mbuf, ML_OPEN, i, HTML_TAG_META, 2, attr))
- return(0);
-
- if ( ! html_tputln(mbuf, ML_OPEN, i, HTML_TAG_TITLE))
- return(0);
- if ( ! ml_putstring(mbuf, ts, NULL))
- return(0);
- if ( ! html_tputln(mbuf, ML_CLOSE, i, HTML_TAG_TITLE))
- return(0);
-
- if (HTML_CSS_EMBED & args->params.html.flags) {
- attr[0].attr = HTML_ATTR_TYPE;
- attr[0].val = "text/css";
-
- if ( ! html_aputln(mbuf, ML_OPEN, i,
- HTML_TAG_STYLE, 1, attr))
- return(0);
- if ( ! html_commentput(mbuf, ML_OPEN, NULL))
- return(0);
-
- if ( ! html_loadcss(mbuf, args->params.html.css))
- return(0);
-
- if ( ! html_commentput(mbuf, ML_CLOSE, NULL))
- return(0);
- if ( ! html_tputln(mbuf, ML_CLOSE, i, HTML_TAG_STYLE))
- return(0);
- } else {
- attr[0].attr = HTML_ATTR_REL;
- attr[0].val = "stylesheet";
- attr[1].attr = HTML_ATTR_TYPE;
- attr[1].val = "text/css";
- attr[2].attr = HTML_ATTR_HREF;
- attr[2].val = args->params.html.css;
-
- if ( ! html_aputln(mbuf, ML_OPEN, i,
- HTML_TAG_LINK, 3, attr))
- return(0);
- }
-
- if ( ! html_tputln(mbuf, ML_CLOSE, --i, HTML_TAG_HEAD))
- return(0);
- if ( ! html_tputln(mbuf, ML_OPEN, i, HTML_TAG_BODY))
- return(0);
-
- attr[0].attr = HTML_ATTR_CLASS;
- attr[0].val = "mdoc";
-
- if ( ! html_aputln(mbuf, ML_OPEN, i, HTML_TAG_DIV, 1, attr))
- return(0);
-
- attr[0].attr = HTML_ATTR_WIDTH;
- attr[0].val = "100%";
- attr[1].attr = HTML_ATTR_CLASS;
- attr[1].val = "header-table";
-
- if ( ! html_aputln(mbuf, ML_OPEN, i++, HTML_TAG_TABLE, 2, attr))
- return(0);
- if ( ! html_tputln(mbuf, ML_OPEN, i++, HTML_TAG_TR))
- return(0);
-
- attr[0].attr = HTML_ATTR_ALIGN;
- attr[0].val = "left";
- attr[1].attr = HTML_ATTR_CLASS;
- attr[1].val = "header-section";
-
- if ( ! html_aputln(mbuf, ML_OPEN, i, HTML_TAG_TD, 2, attr))
- return(0);
- if ( ! ml_putstring(mbuf, ts, NULL))
- return(0);
- if ( ! html_tputln(mbuf, ML_CLOSE, i, HTML_TAG_TD))
- return(0);
-
- attr[0].attr = HTML_ATTR_ALIGN;
- attr[0].val = "center";
- attr[1].attr = HTML_ATTR_CLASS;
- attr[1].val = "header-volume";
-
- if ( ! html_aputln(mbuf, ML_OPEN, i, HTML_TAG_TD, 2, attr))
- return(0);
- if ( ! ml_putstring(mbuf, title, NULL))
- return(0);
- if ( ! html_tputln(mbuf, ML_CLOSE, i, HTML_TAG_TD))
- return(0);
-
- attr[0].attr = HTML_ATTR_ALIGN;
- attr[0].val = "right";
- attr[1].attr = HTML_ATTR_CLASS;
- attr[1].val = "header-section";
-
- if ( ! html_aputln(mbuf, ML_OPEN, i, HTML_TAG_TD, 2, attr))
- return(0);
- if ( ! ml_putstring(mbuf, ts, NULL))
- return(0);
- if ( ! html_tputln(mbuf, ML_CLOSE, i, HTML_TAG_TD))
- return(0);
-
- if ( ! html_tputln(mbuf, ML_CLOSE, --i, HTML_TAG_TR))
- return(0);
- return(html_tputln(mbuf, ML_CLOSE, --i, HTML_TAG_TABLE));
-}
-
-
-/* ARGSUSED */
-static int
-html_end(struct md_mbuf *mbuf, const struct md_args *args,
- const struct tm *tm, const char *os,
- const char *name, enum roffmsec msec, enum roffvol vol)
-{
- struct html_pair attr[4];
- int i;
- char ts[64];