=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.1 retrieving revision 1.6 diff -u -p -r1.1 -r1.6 --- mandoc/mdoc_html.c 2009/09/21 14:56:57 1.1 +++ mandoc/mdoc_html.c 2009/09/24 11:05:45 1.6 @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.1 2009/09/21 14:56:57 kristaps Exp $ */ +/* $Id: mdoc_html.c,v 1.6 2009/09/24 11:05:45 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -61,12 +61,20 @@ static int mdoc_tbl_head_pre(MDOC_ARGS, int, int); static int mdoc_ad_pre(MDOC_ARGS); static int mdoc_an_pre(MDOC_ARGS); +static int mdoc_ap_pre(MDOC_ARGS); static void mdoc_aq_post(MDOC_ARGS); static int mdoc_aq_pre(MDOC_ARGS); static int mdoc_ar_pre(MDOC_ARGS); static int mdoc_bd_pre(MDOC_ARGS); +static int mdoc_bf_pre(MDOC_ARGS); static void mdoc_bl_post(MDOC_ARGS); static int mdoc_bl_pre(MDOC_ARGS); +static void mdoc_bq_post(MDOC_ARGS); +static int mdoc_bq_pre(MDOC_ARGS); +static void mdoc_brq_post(MDOC_ARGS); +static int mdoc_brq_pre(MDOC_ARGS); +static int mdoc_bt_pre(MDOC_ARGS); +static int mdoc_bx_pre(MDOC_ARGS); static int mdoc_cd_pre(MDOC_ARGS); static int mdoc_d1_pre(MDOC_ARGS); static void mdoc_dq_post(MDOC_ARGS); @@ -81,23 +89,37 @@ static int mdoc_em_pre(MDOC_ARGS); static int mdoc_er_pre(MDOC_ARGS); static int mdoc_ev_pre(MDOC_ARGS); static int mdoc_ex_pre(MDOC_ARGS); +static void mdoc_fo_post(MDOC_ARGS); +static int mdoc_fo_pre(MDOC_ARGS); +static int mdoc_ic_pre(MDOC_ARGS); +static int mdoc_in_pre(MDOC_ARGS); static int mdoc_it_pre(MDOC_ARGS); +static int mdoc_lb_pre(MDOC_ARGS); +static int mdoc_li_pre(MDOC_ARGS); +static int mdoc_lk_pre(MDOC_ARGS); +static int mdoc_mt_pre(MDOC_ARGS); +static int mdoc_ms_pre(MDOC_ARGS); static int mdoc_nd_pre(MDOC_ARGS); static int mdoc_nm_pre(MDOC_ARGS); static int mdoc_ns_pre(MDOC_ARGS); static void mdoc_op_post(MDOC_ARGS); static int mdoc_op_pre(MDOC_ARGS); static int mdoc_pa_pre(MDOC_ARGS); +static void mdoc_pf_post(MDOC_ARGS); +static int mdoc_pf_pre(MDOC_ARGS); static void mdoc_pq_post(MDOC_ARGS); static int mdoc_pq_pre(MDOC_ARGS); -static void mdoc_qq_post(MDOC_ARGS); -static int mdoc_qq_pre(MDOC_ARGS); +static int mdoc_rs_pre(MDOC_ARGS); +static int mdoc_rv_pre(MDOC_ARGS); static int mdoc_sh_pre(MDOC_ARGS); static int mdoc_sp_pre(MDOC_ARGS); static void mdoc_sq_post(MDOC_ARGS); static int mdoc_sq_pre(MDOC_ARGS); static int mdoc_ss_pre(MDOC_ARGS); static int mdoc_sx_pre(MDOC_ARGS); +static int mdoc_sy_pre(MDOC_ARGS); +static int mdoc_ud_pre(MDOC_ARGS); +static int mdoc_va_pre(MDOC_ARGS); static int mdoc_vt_pre(MDOC_ARGS); static int mdoc_xr_pre(MDOC_ARGS); static int mdoc_xx_pre(MDOC_ARGS); @@ -108,7 +130,7 @@ extern size_t strlcat(char *, const char *, size_ #endif static const struct htmlmdoc mdocs[MDOC_MAX] = { - {NULL, NULL}, /* Ap */ + {mdoc_ap_pre, NULL}, /* Ap */ {NULL, NULL}, /* Dd */ {NULL, NULL}, /* Dt */ {NULL, NULL}, /* Os */ @@ -136,17 +158,17 @@ static const struct htmlmdoc mdocs[MDOC_MAX] = { {mdoc_fl_pre, NULL}, /* Fl */ {mdoc_fn_pre, NULL}, /* Fn */ {mdoc_ft_pre, NULL}, /* Ft */ - {NULL, NULL}, /* Ic */ - {NULL, NULL}, /* In */ - {NULL, NULL}, /* Li */ + {mdoc_ic_pre, NULL}, /* Ic */ + {mdoc_in_pre, NULL}, /* In */ + {mdoc_li_pre, NULL}, /* Li */ {mdoc_nd_pre, NULL}, /* Nd */ {mdoc_nm_pre, NULL}, /* Nm */ {mdoc_op_pre, mdoc_op_post}, /* Op */ {NULL, NULL}, /* Ot */ {mdoc_pa_pre, NULL}, /* Pa */ - {NULL, NULL}, /* Rv */ + {mdoc_rv_pre, NULL}, /* Rv */ {NULL, NULL}, /* St */ - {NULL, NULL}, /* Va */ + {mdoc_va_pre, NULL}, /* Va */ {mdoc_vt_pre, NULL}, /* Vt */ {mdoc_xr_pre, NULL}, /* Xr */ {NULL, NULL}, /* %A */ @@ -165,65 +187,65 @@ static const struct htmlmdoc mdocs[MDOC_MAX] = { {mdoc_aq_pre, mdoc_aq_post}, /* Aq */ {NULL, NULL}, /* At */ {NULL, NULL}, /* Bc */ - {NULL, NULL}, /* Bf */ - {NULL, NULL}, /* Bo */ - {NULL, NULL}, /* Bq */ + {mdoc_bf_pre, NULL}, /* Bf */ + {mdoc_bq_pre, mdoc_bq_post}, /* Bo */ + {mdoc_bq_pre, mdoc_bq_post}, /* Bq */ {mdoc_xx_pre, NULL}, /* Bsx */ - {NULL, NULL}, /* Bx */ + {mdoc_bx_pre, NULL}, /* Bx */ {NULL, NULL}, /* Db */ {NULL, NULL}, /* Dc */ - {NULL, NULL}, /* Do */ + {mdoc_dq_pre, mdoc_dq_post}, /* Do */ {mdoc_dq_pre, mdoc_dq_post}, /* Dq */ {NULL, NULL}, /* Ec */ {NULL, NULL}, /* Ef */ {mdoc_em_pre, NULL}, /* Em */ {NULL, NULL}, /* Eo */ {mdoc_xx_pre, NULL}, /* Fx */ - {NULL, NULL}, /* Ms */ + {mdoc_ms_pre, NULL}, /* Ms */ /* FIXME: convert to symbol? */ {NULL, NULL}, /* No */ {mdoc_ns_pre, NULL}, /* Ns */ {mdoc_xx_pre, NULL}, /* Nx */ {mdoc_xx_pre, NULL}, /* Ox */ {NULL, NULL}, /* Pc */ - {NULL, NULL}, /* Pf */ + {mdoc_pf_pre, mdoc_pf_post}, /* Pf */ {mdoc_pq_pre, mdoc_pq_post}, /* Po */ {mdoc_pq_pre, mdoc_pq_post}, /* Pq */ {NULL, NULL}, /* Qc */ - {NULL, NULL}, /* Ql */ - {mdoc_qq_pre, mdoc_qq_post}, /* Qo */ - {mdoc_qq_pre, mdoc_qq_post}, /* Qq */ + {mdoc_sq_pre, mdoc_sq_post}, /* Ql */ + {mdoc_dq_pre, mdoc_dq_post}, /* Qo */ + {mdoc_dq_pre, mdoc_dq_post}, /* Qq */ {NULL, NULL}, /* Re */ - {NULL, NULL}, /* Rs */ + {mdoc_rs_pre, NULL}, /* Rs */ {NULL, NULL}, /* Sc */ {mdoc_sq_pre, mdoc_sq_post}, /* So */ {mdoc_sq_pre, mdoc_sq_post}, /* Sq */ - {NULL, NULL}, /* Sm */ + {NULL, NULL}, /* Sm */ /* FIXME - no idea. */ {mdoc_sx_pre, NULL}, /* Sx */ - {NULL, NULL}, /* Sy */ + {mdoc_sy_pre, NULL}, /* Sy */ {NULL, NULL}, /* Tn */ {mdoc_xx_pre, NULL}, /* Ux */ {NULL, NULL}, /* Xc */ {NULL, NULL}, /* Xo */ - {NULL, NULL}, /* Fo */ + {mdoc_fo_pre, mdoc_fo_post}, /* Fo */ {NULL, NULL}, /* Fc */ - {NULL, NULL}, /* Oo */ + {mdoc_op_pre, mdoc_op_post}, /* Oo */ {NULL, NULL}, /* Oc */ {NULL, NULL}, /* Bk */ {NULL, NULL}, /* Ek */ - {NULL, NULL}, /* Bt */ + {mdoc_bt_pre, NULL}, /* Bt */ {NULL, NULL}, /* Hf */ {NULL, NULL}, /* Fr */ - {NULL, NULL}, /* Ud */ - {NULL, NULL}, /* Lb */ + {mdoc_ud_pre, NULL}, /* Ud */ + {mdoc_lb_pre, NULL}, /* Lb */ {mdoc_sp_pre, NULL}, /* Lp */ - {NULL, NULL}, /* Lk */ - {NULL, NULL}, /* Mt */ - {NULL, NULL}, /* Brq */ - {NULL, NULL}, /* Bro */ + {mdoc_lk_pre, NULL}, /* Lk */ + {mdoc_mt_pre, NULL}, /* Mt */ + {mdoc_brq_pre, mdoc_brq_post}, /* Brq */ + {mdoc_brq_pre, mdoc_brq_post}, /* Bro */ {NULL, NULL}, /* Brc */ {NULL, NULL}, /* %C */ - {NULL, NULL}, /* Es */ - {NULL, NULL}, /* En */ + {NULL, NULL}, /* Es */ /* TODO */ + {NULL, NULL}, /* En */ /* TODO */ {mdoc_xx_pre, NULL}, /* Dx */ {NULL, NULL}, /* %Q */ {mdoc_sp_pre, NULL}, /* br */ @@ -502,19 +524,19 @@ mdoc_root_pre(MDOC_ARGS) tag[0].key = ATTR_STYLE; tag[0].val = "width: 33%;"; print_otag(h, TAG_TD, 1, tag); - print_text(h, b); + print_text(h, title); print_stagq(h, tt); tag[0].key = ATTR_STYLE; tag[0].val = "width: 33%; text-align: center;"; print_otag(h, TAG_TD, 1, tag); - print_text(h, title); + print_text(h, b); print_stagq(h, tt); tag[0].key = ATTR_STYLE; tag[0].val = "width: 33%; text-align: right;"; print_otag(h, TAG_TD, 1, tag); - print_text(h, b); + print_text(h, title); print_tagq(h, t); return(1); @@ -823,6 +845,29 @@ mdoc_xx_pre(MDOC_ARGS) /* ARGSUSED */ static int +mdoc_bx_pre(MDOC_ARGS) +{ + const struct mdoc_node *nn; + struct htmlpair tag; + + tag.key = ATTR_CLASS; + tag.val = "unix"; + + print_otag(h, TAG_SPAN, 1, &tag); + + for (nn = n->child; nn; nn = nn->next) + print_mdoc_node(m, nn, h); + + if (n->child) + h->flags |= HTML_NOSPACE; + + print_text(h, "BSD"); + return(0); +} + + +/* ARGSUSED */ +static int mdoc_tbl_block_pre(MDOC_ARGS, int t, int w, int o, int c) { struct htmlpair tag; @@ -888,9 +933,11 @@ mdoc_tbl_head_pre(MDOC_ARGS, int t, int w) print_otag(h, TAG_DIV, 1, &tag); break; default: - buffmt("margin-left: -%dem;", w); + buffmt("margin-left: -%dem; min-width: %dem;", + w, w ? w - 1 : 0); bufcat("clear: left;"); - bufcat("float: left;"); + if (n->next && n->next->child) + bufcat("float: left;"); bufcat("padding-right: 1em;"); tag.key = ATTR_STYLE; tag.val = buf; @@ -915,7 +962,7 @@ mdoc_tbl_head_pre(MDOC_ARGS, int t, int w) print_text(h, "\\(en"); return(0); case (MDOC_Hyphen): - print_text(h, "\\-"); + print_text(h, "\\(hy"); return(0); case (MDOC_Bullet): print_text(h, "\\(bu"); @@ -1196,7 +1243,7 @@ mdoc_d1_pre(MDOC_ARGS) buffmt("margin-left: %dem;", INDENT); tag[0].key = ATTR_CLASS; - tag[0].val = "lit-block"; + tag[0].val = "lit"; tag[1].key = ATTR_STYLE; tag[1].val = buf; @@ -1315,7 +1362,7 @@ mdoc_bd_pre(MDOC_ARGS) tag[0].key = ATTR_STYLE; tag[0].val = buf; tag[1].key = ATTR_CLASS; - tag[1].val = "lit-block"; + tag[1].val = "lit"; print_otag(h, TAG_DIV, 2, tag); @@ -1346,31 +1393,6 @@ mdoc_pa_pre(MDOC_ARGS) /* ARGSUSED */ static int -mdoc_qq_pre(MDOC_ARGS) -{ - - if (MDOC_BODY != n->type) - return(1); - print_text(h, "\\*q"); - h->flags |= HTML_NOSPACE; - return(1); -} - - -/* ARGSUSED */ -static void -mdoc_qq_post(MDOC_ARGS) -{ - - if (MDOC_BODY != n->type) - return; - h->flags |= HTML_NOSPACE; - print_text(h, "\\*q"); -} - - -/* ARGSUSED */ -static int mdoc_ad_pre(MDOC_ARGS) { struct htmlpair tag; @@ -1521,6 +1543,7 @@ mdoc_vt_pre(MDOC_ARGS) return(1); } + /* ARGSUSED */ static int mdoc_ft_pre(MDOC_ARGS) @@ -1530,7 +1553,7 @@ mdoc_ft_pre(MDOC_ARGS) if (SEC_SYNOPSIS == n->sec) { if (n->prev && MDOC_Fo == n->prev->tok) { tag.key = ATTR_STYLE; - tag.val = "magin-bottom: 1em;"; + tag.val = "margin-top: 1em;"; print_otag(h, TAG_DIV, 1, &tag); } else print_otag(h, TAG_DIV, 0, NULL); @@ -1563,6 +1586,8 @@ mdoc_fn_pre(MDOC_ARGS) tag.key = ATTR_CLASS; tag.val = "type"; + /* FIXME: can be "type funcname" "type varname"... */ + t = print_otag(h, TAG_SPAN, 1, &tag); print_text(h, n->child->string); print_tagq(h, t); @@ -1614,4 +1639,443 @@ mdoc_sp_pre(MDOC_ARGS) print_otag(h, TAG_DIV, 1, &tag); return(1); +} + + +/* ARGSUSED */ +static int +mdoc_brq_pre(MDOC_ARGS) +{ + + if (MDOC_BODY != n->type) + return(1); + print_text(h, "\\(lC"); + h->flags |= HTML_NOSPACE; + return(1); +} + + +/* ARGSUSED */ +static void +mdoc_brq_post(MDOC_ARGS) +{ + + if (MDOC_BODY != n->type) + return; + h->flags |= HTML_NOSPACE; + print_text(h, "\\(rC"); +} + + +/* ARGSUSED */ +static int +mdoc_lk_pre(MDOC_ARGS) +{ + const struct mdoc_node *nn; + struct htmlpair tag[2]; + + nn = n->child; + + tag[0].key = ATTR_CLASS; + tag[0].val = "link-ext"; + tag[1].key = ATTR_HREF; + tag[1].val = nn->string; + + print_otag(h, TAG_A, 2, tag); + + if (NULL == nn->next) + return(1); + + for (nn = nn->next; nn; nn = nn->next) + print_text(h, nn->string); + + return(0); +} + + +/* ARGSUSED */ +static int +mdoc_mt_pre(MDOC_ARGS) +{ + struct htmlpair tag[2]; + struct tag *t; + const struct mdoc_node *nn; + + tag[0].key = ATTR_CLASS; + tag[0].val = "link-mail"; + + for (nn = n->child; nn; nn = nn->next) { + bufinit(); + bufcat("mailto:"); + bufcat(nn->string); + + tag[1].key = ATTR_HREF; + tag[1].val = buf; + + t = print_otag(h, TAG_A, 2, tag); + print_text(h, nn->string); + print_tagq(h, t); + } + + return(0); +} + + +/* ARGSUSED */ +static int +mdoc_fo_pre(MDOC_ARGS) +{ + struct htmlpair tag; + + if (MDOC_BODY == n->type) { + h->flags |= HTML_NOSPACE; + print_text(h, "("); + h->flags |= HTML_NOSPACE; + return(1); + } else if (MDOC_BLOCK == n->type) + return(1); + + tag.key = ATTR_CLASS; + tag.val = "fname"; + print_otag(h, TAG_SPAN, 1, &tag); + return(1); +} + + +/* ARGSUSED */ +static void +mdoc_fo_post(MDOC_ARGS) +{ + if (MDOC_BODY != n->type) + return; + h->flags |= HTML_NOSPACE; + print_text(h, ")"); + h->flags |= HTML_NOSPACE; + print_text(h, ";"); +} + + +/* ARGSUSED */ +static int +mdoc_in_pre(MDOC_ARGS) +{ + const struct mdoc_node *nn; + struct htmlpair tag; + + if (SEC_SYNOPSIS == n->sec) { + if (n->next && MDOC_In != n->next->tok) { + tag.key = ATTR_STYLE; + tag.val = "margin-bottom: 1em;"; + print_otag(h, TAG_DIV, 1, &tag); + } else + print_otag(h, TAG_DIV, 0, NULL); + } + + tag.key = ATTR_CLASS; + tag.val = "includes"; + + print_otag(h, TAG_SPAN, 1, &tag); + + if (SEC_SYNOPSIS == n->sec) + print_text(h, "#include"); + + print_text(h, "<"); + h->flags |= HTML_NOSPACE; + + /* XXX -- see warning in termp_in_post(). */ + + for (nn = n->child; nn; nn = nn->next) + print_mdoc_node(m, nn, h); + + h->flags |= HTML_NOSPACE; + print_text(h, ">"); + + return(0); +} + + +/* ARGSUSED */ +static int +mdoc_ic_pre(MDOC_ARGS) +{ + struct htmlpair tag; + + tag.key = ATTR_CLASS; + tag.val = "cmd"; + + print_otag(h, TAG_SPAN, 1, &tag); + return(1); +} + + +/* ARGSUSED */ +static int +mdoc_rv_pre(MDOC_ARGS) +{ + const struct mdoc_node *nn; + struct htmlpair tag; + struct tag *t; + + print_otag(h, TAG_DIV, 0, NULL); + + print_text(h, "The"); + + for (nn = n->child; nn; nn = nn->next) { + tag.key = ATTR_CLASS; + tag.val = "fname"; + t = print_otag(h, TAG_SPAN, 1, &tag); + print_text(h, nn->string); + print_tagq(h, t); + + h->flags |= HTML_NOSPACE; + if (nn->next && NULL == nn->next->next) + print_text(h, "(), and"); + else if (nn->next) + print_text(h, "(),"); + else + print_text(h, "()"); + } + + if (n->child->next) + print_text(h, "functions return"); + else + print_text(h, "function returns"); + + print_text(h, "the value 0 if successful; otherwise the value " + "-1 is returned and the global variable"); + + tag.key = ATTR_CLASS; + tag.val = "var"; + t = print_otag(h, TAG_SPAN, 1, &tag); + print_text(h, "errno"); + print_tagq(h, t); + print_text(h, "is set to indicate the error."); + return(0); +} + + +/* ARGSUSED */ +static int +mdoc_va_pre(MDOC_ARGS) +{ + struct htmlpair tag; + + tag.key = ATTR_CLASS; + tag.val = "var"; + print_otag(h, TAG_SPAN, 1, &tag); + return(1); +} + + +/* ARGSUSED */ +static int +mdoc_bq_pre(MDOC_ARGS) +{ + + if (MDOC_BODY != n->type) + return(1); + print_text(h, "\\(lB"); + h->flags |= HTML_NOSPACE; + return(1); +} + + +/* ARGSUSED */ +static void +mdoc_bq_post(MDOC_ARGS) +{ + + if (MDOC_BODY != n->type) + return; + h->flags |= HTML_NOSPACE; + print_text(h, "\\(rB"); +} + + +/* ARGSUSED */ +static int +mdoc_ap_pre(MDOC_ARGS) +{ + + h->flags |= HTML_NOSPACE; + print_text(h, "\\(aq"); + h->flags |= HTML_NOSPACE; + return(1); +} + + +/* ARGSUSED */ +static int +mdoc_bf_pre(MDOC_ARGS) +{ + int i; + struct htmlpair tag[2]; + + if (MDOC_HEAD == n->type) + return(0); + else if (MDOC_BLOCK != n->type) + return(1); + + tag[0].key = ATTR_CLASS; + tag[0].val = NULL; + + if (n->head->child) { + if ( ! strcmp("Em", n->head->child->string)) + tag[0].val = "emph"; + else if ( ! strcmp("Sy", n->head->child->string)) + tag[0].val = "symb"; + else if ( ! strcmp("Li", n->head->child->string)) + tag[0].val = "lit"; + } else { + assert(n->args); + for (i = 0; i < (int)n->args->argc; i++) + switch (n->args->argv[i].arg) { + case (MDOC_Symbolic): + tag[0].val = "symb"; + break; + case (MDOC_Literal): + tag[0].val = "lit"; + break; + case (MDOC_Emphasis): + tag[0].val = "emph"; + break; + default: + break; + } + } + + /* FIXME: div's have spaces stripped--we want them. */ + + assert(tag[0].val); + tag[1].key = ATTR_STYLE; + tag[1].val = "display: inline; margin-right: 1em;"; + print_otag(h, TAG_DIV, 2, tag); + return(1); +} + + +/* ARGSUSED */ +static int +mdoc_ms_pre(MDOC_ARGS) +{ + struct htmlpair tag; + + tag.key = ATTR_CLASS; + tag.val = "symb"; + print_otag(h, TAG_SPAN, 1, &tag); + return(1); +} + + +/* ARGSUSED */ +static int +mdoc_pf_pre(MDOC_ARGS) +{ + + h->flags |= HTML_IGNDELIM; + return(1); +} + + +/* ARGSUSED */ +static void +mdoc_pf_post(MDOC_ARGS) +{ + + h->flags &= ~HTML_IGNDELIM; + h->flags |= HTML_NOSPACE; +} + + +/* ARGSUSED */ +static int +mdoc_rs_pre(MDOC_ARGS) +{ + struct htmlpair tag[2]; + int i; + + if (MDOC_BLOCK != n->type) + return(1); + + tag[i = 0].key = ATTR_CLASS; + tag[i++].val = "ref"; + + if (n->prev && SEC_SYNOPSIS == n->sec) { + tag[i].key = ATTR_STYLE; + tag[i++].val = "margin-top: 1em;"; + } else if (SEC_SYNOPSIS != n->sec) { + tag[i].key = ATTR_STYLE; + tag[i++].val = "display: inline; margin-right: 1em"; + } + + /* FIXME: div's have spaces stripped--we want them. */ + + print_otag(h, TAG_DIV, i, tag); + return(1); +} + + + +/* ARGSUSED */ +static int +mdoc_li_pre(MDOC_ARGS) +{ + struct htmlpair tag; + + tag.key = ATTR_CLASS; + tag.val = "lit"; + + print_otag(h, TAG_SPAN, 1, &tag); + return(1); +} + + +/* ARGSUSED */ +static int +mdoc_sy_pre(MDOC_ARGS) +{ + struct htmlpair tag; + + tag.key = ATTR_CLASS; + tag.val = "symb"; + + print_otag(h, TAG_SPAN, 1, &tag); + return(1); +} + + +/* ARGSUSED */ +static int +mdoc_bt_pre(MDOC_ARGS) +{ + + print_text(h, "is currently in beta test."); + return(0); +} + + +/* ARGSUSED */ +static int +mdoc_ud_pre(MDOC_ARGS) +{ + + print_text(h, "currently under development."); + return(0); +} + + +/* ARGSUSED */ +static int +mdoc_lb_pre(MDOC_ARGS) +{ + struct htmlpair tag; + + tag.key = ATTR_CLASS; + tag.val = "lib"; + + if (SEC_SYNOPSIS == n->sec) + print_otag(h, TAG_DIV, 0, NULL); + + print_otag(h, TAG_SPAN, 1, &tag); + return(1); }