static int mdoc_ss_pre(MDOC_ARGS) { struct htmlpair tag; if (MDOC_BLOCK == n->type) { PAIR_CLASS_INIT(&tag, "subsection"); print_otag(h, TAG_DIV, 1, &tag); return(1); } else if (MDOC_BODY == n->type) return(1); bufinit(h); bufcat(h, "x"); for (n = n->child; n && MDOC_TEXT == n->type; ) { bufcat_id(h, n->string); if (NULL != (n = n->next)) bufcat_id(h, " "); } if (NULL == n) { PAIR_ID_INIT(&tag, h->buf); print_otag(h, TAG_H2, 1, &tag); } else print_otag(h, TAG_H2, 0, NULL); return(1); }
static int mdoc_sh_pre(MDOC_ARGS) { struct htmlpair tag; switch (n->type) { case MDOC_BLOCK: PAIR_CLASS_INIT(&tag, "section"); print_otag(h, TAG_DIV, 1, &tag); return(1); case MDOC_BODY: if (n->sec == SEC_AUTHORS) h->flags &= ~(HTML_SPLIT|HTML_NOSPLIT); return(1); default: break; } bufinit(h); bufcat(h, "x"); for (n = n->child; n && MDOC_TEXT == n->type; ) { bufcat_id(h, n->string); if (NULL != (n = n->next)) bufcat_id(h, " "); } if (NULL == n) { PAIR_ID_INIT(&tag, h->buf); print_otag(h, TAG_H1, 1, &tag); } else print_otag(h, TAG_H1, 0, NULL); return(1); }
/* ARGSUSED */ static int mdoc_sx_pre(MDOC_ARGS) { struct htmlpair tag[2]; bufinit(h); bufcat(h, "#x"); for (n = n->child; n; n = n->next) { bufcat_id(h, n->string); if (n->next) bufcat_id(h, " "); } PAIR_CLASS_INIT(&tag[0], "link-sec"); PAIR_HREF_INIT(&tag[1], h->buf); print_otag(h, TAG_I, 1, tag); print_otag(h, TAG_A, 2, tag); return(1); }
/* ARGSUSED */ static int mdoc_sh_pre(MDOC_ARGS) { struct htmlpair tag; if (MDOC_BLOCK == n->type) { PAIR_CLASS_INIT(&tag, "section"); print_otag(h, TAG_DIV, 1, &tag); return(1); } else if (MDOC_BODY == n->type) return(1); bufinit(h); for (n = n->child; n; n = n->next) { bufcat_id(h, n->string); if (n->next) bufcat_id(h, " "); } PAIR_ID_INIT(&tag, h->buf); print_otag(h, TAG_H1, 1, &tag); return(1); }