version 1.18, 2009/10/03 16:36:06 |
version 1.20, 2009/10/03 19:57:53 |
|
|
#define MDOC_ARGS const struct mdoc_meta *m, \ |
#define MDOC_ARGS const struct mdoc_meta *m, \ |
const struct mdoc_node *n, \ |
const struct mdoc_node *n, \ |
struct html *h |
struct html *h |
#define MAN_ARGS const struct man_meta *m, \ |
|
const struct man_node *n, \ |
|
struct html *h |
|
|
|
struct htmlmdoc { |
struct htmlmdoc { |
int (*pre)(MDOC_ARGS); |
int (*pre)(MDOC_ARGS); |
Line 385 print_mdoc(MDOC_ARGS) |
|
Line 382 print_mdoc(MDOC_ARGS) |
|
static void |
static void |
print_mdoc_head(MDOC_ARGS) |
print_mdoc_head(MDOC_ARGS) |
{ |
{ |
char b[BUFSIZ]; |
|
|
|
print_gen_head(h); |
print_gen_head(h); |
|
bufinit(h); |
|
buffmt(h, "%s(%d)", m->title, m->msec); |
|
|
(void)snprintf(b, BUFSIZ - 1, |
|
"%s(%d)", m->title, m->msec); |
|
|
|
if (m->arch) { |
if (m->arch) { |
(void)strlcat(b, " (", BUFSIZ); |
bufcat(h, " ("); |
(void)strlcat(b, m->arch, BUFSIZ); |
bufcat(h, m->arch); |
(void)strlcat(b, ")", BUFSIZ); |
bufcat(h, ")"); |
} |
} |
|
|
print_otag(h, TAG_TITLE, 0, NULL); |
print_otag(h, TAG_TITLE, 0, NULL); |
print_text(h, b); |
print_text(h, h->buf); |
} |
} |
|
|
|
|
Line 1438 mdoc_an_pre(MDOC_ARGS) |
|
Line 1433 mdoc_an_pre(MDOC_ARGS) |
|
{ |
{ |
struct htmlpair tag; |
struct htmlpair tag; |
|
|
|
/* TODO: -split and -nosplit (see termp_an_pre()). */ |
|
|
tag.key = ATTR_CLASS; |
tag.key = ATTR_CLASS; |
tag.val = "author"; |
tag.val = "author"; |
print_otag(h, TAG_SPAN, 1, &tag); |
print_otag(h, TAG_SPAN, 1, &tag); |
Line 1616 mdoc_fn_pre(MDOC_ARGS) |
|
Line 1613 mdoc_fn_pre(MDOC_ARGS) |
|
} |
} |
|
|
/* Split apart into type and name. */ |
/* Split apart into type and name. */ |
|
|
tag[0].key = ATTR_CLASS; |
|
tag[0].val = "ftype"; |
|
t = print_otag(h, TAG_SPAN, 1, tag); |
|
|
|
assert(n->child->string); |
assert(n->child->string); |
sp = n->child->string; |
sp = n->child->string; |
while (NULL != (ep = strchr(sp, ' '))) { |
|
sz = MIN((int)(ep - sp), BUFSIZ - 1); |
|
(void)memcpy(nbuf, sp, (size_t)sz); |
|
nbuf[sz] = '\0'; |
|
print_text(h, nbuf); |
|
sp = ++ep; |
|
} |
|
|
|
print_tagq(h, t); |
if ((ep = strchr(sp, ' '))) { |
|
tag[0].key = ATTR_CLASS; |
|
tag[0].val = "ftype"; |
|
|
|
t = print_otag(h, TAG_SPAN, 1, tag); |
|
|
|
while (ep) { |
|
sz = MIN((int)(ep - sp), BUFSIZ - 1); |
|
(void)memcpy(nbuf, sp, (size_t)sz); |
|
nbuf[sz] = '\0'; |
|
print_text(h, nbuf); |
|
sp = ++ep; |
|
ep = strchr(sp, ' '); |
|
} |
|
print_tagq(h, t); |
|
} |
|
|
tag[0].key = ATTR_CLASS; |
tag[0].key = ATTR_CLASS; |
tag[0].val = "fname"; |
tag[0].val = "fname"; |