version 1.79, 2011/07/21 11:34:53 |
version 1.85, 2011/12/04 00:44:12 |
|
|
/* FIXME: have PD set the default vspace width. */ |
/* FIXME: have PD set the default vspace width. */ |
|
|
#define INDENT 5 |
#define INDENT 5 |
#define HALFINDENT 3 |
|
|
|
#define MAN_ARGS const struct man_meta *m, \ |
#define MAN_ARGS const struct man_meta *m, \ |
const struct man_node *n, \ |
const struct man_node *n, \ |
Line 142 print_bvspace(struct html *h, const struct man_node *n |
|
Line 141 print_bvspace(struct html *h, const struct man_node *n |
|
void |
void |
html_man(void *arg, const struct man *m) |
html_man(void *arg, const struct man *m) |
{ |
{ |
struct html *h; |
|
struct tag *t; |
|
struct mhtml mh; |
struct mhtml mh; |
|
|
h = (struct html *)arg; |
|
|
|
print_gen_decls(h); |
|
|
|
memset(&mh, 0, sizeof(struct mhtml)); |
memset(&mh, 0, sizeof(struct mhtml)); |
|
print_man(man_meta(m), man_node(m), &mh, (struct html *)arg); |
t = print_otag(h, TAG_HTML, 0, NULL); |
putchar('\n'); |
print_man(man_meta(m), man_node(m), &mh, h); |
|
print_tagq(h, t); |
|
|
|
printf("\n"); |
|
} |
} |
|
|
static void |
static void |
print_man(MAN_ARGS) |
print_man(MAN_ARGS) |
{ |
{ |
struct tag *t; |
struct tag *t, *tt; |
|
struct htmlpair tag; |
|
|
t = print_otag(h, TAG_HEAD, 0, NULL); |
PAIR_CLASS_INIT(&tag, "mandoc"); |
print_man_head(m, n, mh, h); |
|
print_tagq(h, t); |
|
|
|
t = print_otag(h, TAG_BODY, 0, NULL); |
if ( ! (HTML_FRAGMENT & h->oflags)) { |
|
print_gen_decls(h); |
|
t = print_otag(h, TAG_HTML, 0, NULL); |
|
tt = print_otag(h, TAG_HEAD, 0, NULL); |
|
print_man_head(m, n, mh, h); |
|
print_tagq(h, tt); |
|
print_otag(h, TAG_BODY, 0, NULL); |
|
print_otag(h, TAG_DIV, 1, &tag); |
|
} else |
|
t = print_otag(h, TAG_DIV, 1, &tag); |
|
|
print_man_nodelist(m, n, mh, h); |
print_man_nodelist(m, n, mh, h); |
print_tagq(h, t); |
print_tagq(h, t); |
} |
} |
Line 180 print_man_head(MAN_ARGS) |
|
Line 178 print_man_head(MAN_ARGS) |
|
{ |
{ |
|
|
print_gen_head(h); |
print_gen_head(h); |
|
assert(m->title); |
|
assert(m->msec); |
bufcat_fmt(h, "%s(%s)", m->title, m->msec); |
bufcat_fmt(h, "%s(%s)", m->title, m->msec); |
print_otag(h, TAG_TITLE, 0, NULL); |
print_otag(h, TAG_TITLE, 0, NULL); |
print_text(h, h->buf); |
print_text(h, h->buf); |
Line 201 print_man_node(MAN_ARGS) |
|
Line 201 print_man_node(MAN_ARGS) |
|
{ |
{ |
int child; |
int child; |
struct tag *t; |
struct tag *t; |
struct htmlpair tag; |
|
|
|
child = 1; |
child = 1; |
t = h->tags.head; |
t = h->tags.head; |
Line 229 print_man_node(MAN_ARGS) |
|
Line 228 print_man_node(MAN_ARGS) |
|
print_text(h, n->string); |
print_text(h, n->string); |
return; |
return; |
case (MAN_EQN): |
case (MAN_EQN): |
PAIR_CLASS_INIT(&tag, "eqn"); |
print_eqn(h, n->eqn); |
/*print_otag(h, TAG_SPAN, 1, &tag); |
|
print_text(h, n->eqn->data);*/ |
|
break; |
break; |
case (MAN_TBL): |
case (MAN_TBL): |
/* |
/* |
Line 310 man_root_pre(MAN_ARGS) |
|
Line 307 man_root_pre(MAN_ARGS) |
|
if (m->vol) |
if (m->vol) |
(void)strlcat(b, m->vol, BUFSIZ); |
(void)strlcat(b, m->vol, BUFSIZ); |
|
|
|
assert(m->title); |
|
assert(m->msec); |
snprintf(title, BUFSIZ - 1, "%s(%s)", m->title, m->msec); |
snprintf(title, BUFSIZ - 1, "%s(%s)", m->title, m->msec); |
|
|
PAIR_SUMMARY_INIT(&tag[0], "Document Header"); |
PAIR_SUMMARY_INIT(&tag[0], "Document Header"); |
PAIR_CLASS_INIT(&tag[1], "head"); |
PAIR_CLASS_INIT(&tag[1], "head"); |
if (NULL == h->style) { |
PAIR_INIT(&tag[2], ATTR_WIDTH, "100%"); |
PAIR_INIT(&tag[2], ATTR_WIDTH, "100%"); |
t = print_otag(h, TAG_TABLE, 3, tag); |
t = print_otag(h, TAG_TABLE, 3, tag); |
PAIR_INIT(&tag[0], ATTR_WIDTH, "30%"); |
PAIR_INIT(&tag[0], ATTR_WIDTH, "30%"); |
print_otag(h, TAG_COL, 1, tag); |
print_otag(h, TAG_COL, 1, tag); |
print_otag(h, TAG_COL, 1, tag); |
print_otag(h, TAG_COL, 1, tag); |
print_otag(h, TAG_COL, 1, tag); |
print_otag(h, TAG_COL, 1, tag); |
|
} else |
|
t = print_otag(h, TAG_TABLE, 2, tag); |
|
|
|
print_otag(h, TAG_TBODY, 0, NULL); |
print_otag(h, TAG_TBODY, 0, NULL); |
|
|
Line 330 man_root_pre(MAN_ARGS) |
|
Line 326 man_root_pre(MAN_ARGS) |
|
|
|
PAIR_CLASS_INIT(&tag[0], "head-ltitle"); |
PAIR_CLASS_INIT(&tag[0], "head-ltitle"); |
print_otag(h, TAG_TD, 1, tag); |
print_otag(h, TAG_TD, 1, tag); |
|
|
print_text(h, title); |
print_text(h, title); |
print_stagq(h, tt); |
print_stagq(h, tt); |
|
|
PAIR_CLASS_INIT(&tag[0], "head-vol"); |
PAIR_CLASS_INIT(&tag[0], "head-vol"); |
if (NULL == h->style) { |
PAIR_INIT(&tag[1], ATTR_ALIGN, "center"); |
PAIR_INIT(&tag[1], ATTR_ALIGN, "center"); |
print_otag(h, TAG_TD, 2, tag); |
print_otag(h, TAG_TD, 2, tag); |
|
} else |
|
print_otag(h, TAG_TD, 1, tag); |
|
|
|
print_text(h, b); |
print_text(h, b); |
print_stagq(h, tt); |
print_stagq(h, tt); |
|
|
PAIR_CLASS_INIT(&tag[0], "head-rtitle"); |
PAIR_CLASS_INIT(&tag[0], "head-rtitle"); |
if (NULL == h->style) { |
PAIR_INIT(&tag[1], ATTR_ALIGN, "right"); |
PAIR_INIT(&tag[1], ATTR_ALIGN, "right"); |
print_otag(h, TAG_TD, 2, tag); |
print_otag(h, TAG_TD, 2, tag); |
|
} else |
|
print_otag(h, TAG_TD, 1, tag); |
|
|
|
print_text(h, title); |
print_text(h, title); |
print_tagq(h, t); |
print_tagq(h, t); |
} |
} |
Line 365 man_root_post(MAN_ARGS) |
|
Line 352 man_root_post(MAN_ARGS) |
|
|
|
PAIR_SUMMARY_INIT(&tag[0], "Document Footer"); |
PAIR_SUMMARY_INIT(&tag[0], "Document Footer"); |
PAIR_CLASS_INIT(&tag[1], "foot"); |
PAIR_CLASS_INIT(&tag[1], "foot"); |
if (NULL == h->style) { |
PAIR_INIT(&tag[2], ATTR_WIDTH, "100%"); |
PAIR_INIT(&tag[2], ATTR_WIDTH, "100%"); |
t = print_otag(h, TAG_TABLE, 3, tag); |
t = print_otag(h, TAG_TABLE, 3, tag); |
PAIR_INIT(&tag[0], ATTR_WIDTH, "50%"); |
PAIR_INIT(&tag[0], ATTR_WIDTH, "50%"); |
print_otag(h, TAG_COL, 1, tag); |
print_otag(h, TAG_COL, 1, tag); |
print_otag(h, TAG_COL, 1, tag); |
print_otag(h, TAG_COL, 1, tag); |
|
} else |
|
t = print_otag(h, TAG_TABLE, 2, tag); |
|
|
|
tt = print_otag(h, TAG_TR, 0, NULL); |
tt = print_otag(h, TAG_TR, 0, NULL); |
|
|
PAIR_CLASS_INIT(&tag[0], "foot-date"); |
PAIR_CLASS_INIT(&tag[0], "foot-date"); |
print_otag(h, TAG_TD, 1, tag); |
print_otag(h, TAG_TD, 1, tag); |
|
|
|
assert(m->date); |
print_text(h, m->date); |
print_text(h, m->date); |
print_stagq(h, tt); |
print_stagq(h, tt); |
|
|
PAIR_CLASS_INIT(&tag[0], "foot-os"); |
PAIR_CLASS_INIT(&tag[0], "foot-os"); |
if (NULL == h->style) { |
PAIR_INIT(&tag[1], ATTR_ALIGN, "right"); |
PAIR_INIT(&tag[1], ATTR_ALIGN, "right"); |
print_otag(h, TAG_TD, 2, tag); |
print_otag(h, TAG_TD, 2, tag); |
|
} else |
|
print_otag(h, TAG_TD, 1, tag); |
|
|
|
if (m->source) |
if (m->source) |
print_text(h, m->source); |
print_text(h, m->source); |