version 1.124, 2010/12/17 01:02:00 |
version 1.127, 2010/12/17 10:43:51 |
Line 299 a2width(const char *p, struct roffsu *su) |
|
Line 299 a2width(const char *p, struct roffsu *su) |
|
static void |
static void |
synopsis_pre(struct html *h, const struct mdoc_node *n) |
synopsis_pre(struct html *h, const struct mdoc_node *n) |
{ |
{ |
struct roffsu su; |
|
struct htmlpair tag; |
|
|
|
if (NULL == n->prev || ! (MDOC_SYNPRETTY & n->flags)) |
if (NULL == n->prev || ! (MDOC_SYNPRETTY & n->flags)) |
return; |
return; |
|
|
SCALE_VS_INIT(&su, 1); |
|
bufcat_su(h, "margin-top", &su); |
|
PAIR_STYLE_INIT(&tag, h); |
|
|
|
if (n->prev->tok == n->tok && |
if (n->prev->tok == n->tok && |
MDOC_Fo != n->tok && |
MDOC_Fo != n->tok && |
MDOC_Ft != n->tok && |
MDOC_Ft != n->tok && |
MDOC_Fn != n->tok) { |
MDOC_Fn != n->tok) { |
print_otag(h, TAG_DIV, 0, NULL); |
print_otag(h, TAG_BR, 0, NULL); |
return; |
return; |
} |
} |
|
|
Line 327 synopsis_pre(struct html *h, const struct mdoc_node *n |
|
Line 321 synopsis_pre(struct html *h, const struct mdoc_node *n |
|
case (MDOC_In): |
case (MDOC_In): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (MDOC_Vt): |
case (MDOC_Vt): |
print_otag(h, TAG_DIV, 1, &tag); |
print_otag(h, TAG_P, 0, NULL); |
break; |
break; |
case (MDOC_Ft): |
case (MDOC_Ft): |
if (MDOC_Fn != n->tok && MDOC_Fo != n->tok) { |
if (MDOC_Fn != n->tok && MDOC_Fo != n->tok) { |
print_otag(h, TAG_DIV, 1, &tag); |
print_otag(h, TAG_P, 0, NULL); |
break; |
break; |
} |
} |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
default: |
default: |
print_otag(h, TAG_DIV, 0, NULL); |
print_otag(h, TAG_BR, 0, NULL); |
break; |
break; |
} |
} |
} |
} |
Line 463 print_mdoc_node(MDOC_ARGS) |
|
Line 457 print_mdoc_node(MDOC_ARGS) |
|
} |
} |
} |
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static void |
static void |
mdoc_root_post(MDOC_ARGS) |
mdoc_root_post(MDOC_ARGS) |
{ |
{ |
struct htmlpair tag[3]; |
struct htmlpair tag[2]; |
struct tag *t, *tt; |
struct tag *t, *tt; |
char b[DATESIZ]; |
char b[DATESIZ]; |
|
|
time2a(m->date, b, DATESIZ); |
time2a(m->date, b, DATESIZ); |
|
|
PAIR_CLASS_INIT(&tag[0], "footer"); |
PAIR_CLASS_INIT(&tag[0], "foot"); |
bufcat_style(h, "width", "100%"); |
PAIR_SUMMARY_INIT(&tag[1], "Document Footer"); |
PAIR_STYLE_INIT(&tag[1], h); |
t = print_otag(h, TAG_TABLE, 2, tag); |
PAIR_SUMMARY_INIT(&tag[2], "footer"); |
|
|
|
t = print_otag(h, TAG_TABLE, 3, tag); |
|
tt = print_otag(h, TAG_TR, 0, NULL); |
tt = print_otag(h, TAG_TR, 0, NULL); |
|
|
bufinit(h); |
PAIR_CLASS_INIT(&tag[0], "foot-date"); |
bufcat_style(h, "width", "50%"); |
|
PAIR_STYLE_INIT(&tag[0], h); |
|
print_otag(h, TAG_TD, 1, tag); |
print_otag(h, TAG_TD, 1, tag); |
|
|
print_text(h, b); |
print_text(h, b); |
print_stagq(h, tt); |
print_stagq(h, tt); |
|
|
bufinit(h); |
PAIR_CLASS_INIT(&tag[0], "foot-os"); |
bufcat_style(h, "width", "50%"); |
|
bufcat_style(h, "text-align", "right"); |
|
PAIR_STYLE_INIT(&tag[0], h); |
|
print_otag(h, TAG_TD, 1, tag); |
print_otag(h, TAG_TD, 1, tag); |
|
|
print_text(h, m->os); |
print_text(h, m->os); |
print_tagq(h, t); |
print_tagq(h, t); |
} |
} |
Line 517 mdoc_root_pre(MDOC_ARGS) |
|
Line 505 mdoc_root_pre(MDOC_ARGS) |
|
|
|
snprintf(title, BUFSIZ - 1, "%s(%s)", m->title, m->msec); |
snprintf(title, BUFSIZ - 1, "%s(%s)", m->title, m->msec); |
|
|
PAIR_CLASS_INIT(&tag[0], "header"); |
PAIR_CLASS_INIT(&tag[0], "head"); |
bufcat_style(h, "width", "100%"); |
PAIR_SUMMARY_INIT(&tag[1], "Document Header"); |
PAIR_STYLE_INIT(&tag[1], h); |
t = print_otag(h, TAG_TABLE, 2, tag); |
PAIR_SUMMARY_INIT(&tag[2], "header"); |
|
|
|
t = print_otag(h, TAG_TABLE, 3, tag); |
|
|
|
tt = print_otag(h, TAG_TR, 0, NULL); |
tt = print_otag(h, TAG_TR, 0, NULL); |
|
|
bufinit(h); |
PAIR_CLASS_INIT(&tag[0], "head-ltitle"); |
bufcat_style(h, "width", "10%"); |
|
PAIR_STYLE_INIT(&tag[0], h); |
|
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); |
|
|
bufinit(h); |
PAIR_CLASS_INIT(&tag[0], "head-vol"); |
bufcat_style(h, "text-align", "center"); |
|
bufcat_style(h, "white-space", "nowrap"); |
|
bufcat_style(h, "width", "80%"); |
|
PAIR_STYLE_INIT(&tag[0], h); |
|
print_otag(h, TAG_TD, 1, tag); |
print_otag(h, TAG_TD, 1, tag); |
|
|
print_text(h, b); |
print_text(h, b); |
print_stagq(h, tt); |
print_stagq(h, tt); |
|
|
bufinit(h); |
PAIR_CLASS_INIT(&tag[0], "head-rtitle"); |
bufcat_style(h, "text-align", "right"); |
|
bufcat_style(h, "width", "10%"); |
|
PAIR_STYLE_INIT(&tag[0], h); |
|
print_otag(h, TAG_TD, 1, tag); |
print_otag(h, TAG_TD, 1, tag); |
|
|
print_text(h, title); |
print_text(h, title); |
print_tagq(h, t); |
print_tagq(h, t); |
return(1); |
return(1); |
Line 1021 mdoc_ex_pre(MDOC_ARGS) |
|
Line 1000 mdoc_ex_pre(MDOC_ARGS) |
|
struct tag *t; |
struct tag *t; |
struct htmlpair tag; |
struct htmlpair tag; |
|
|
|
if (n->prev) |
|
print_otag(h, TAG_BR, 0, NULL); |
|
|
PAIR_CLASS_INIT(&tag, "utility"); |
PAIR_CLASS_INIT(&tag, "utility"); |
|
|
print_text(h, "The"); |
print_text(h, "The"); |
Line 1080 mdoc_d1_pre(MDOC_ARGS) |
|
Line 1062 mdoc_d1_pre(MDOC_ARGS) |
|
/* BLOCKQUOTE needs a block body. */ |
/* BLOCKQUOTE needs a block body. */ |
|
|
if (MDOC_Dl == n->tok) { |
if (MDOC_Dl == n->tok) { |
PAIR_CLASS_INIT(&tag[1], "lit"); |
PAIR_CLASS_INIT(&tag[0], "lit display"); |
print_otag(h, TAG_DIV, 1, tag); |
print_otag(h, TAG_DIV, 1, tag); |
} else |
} else |
print_otag(h, TAG_DIV, 0, tag); |
PAIR_CLASS_INIT(&tag[0], "display"); |
|
print_otag(h, TAG_DIV, 1, tag); |
|
|
return(1); |
return(1); |
} |
} |
Line 1124 mdoc_bd_pre(MDOC_ARGS) |
|
Line 1107 mdoc_bd_pre(MDOC_ARGS) |
|
if (MDOC_HEAD == n->type) |
if (MDOC_HEAD == n->type) |
return(0); |
return(0); |
|
|
SCALE_VS_INIT(&su, 0); |
|
|
|
assert(n->data.Bd); |
|
if (n->data.Bd->offs) |
|
a2offs(n->data.Bd->offs, &su); |
|
|
|
comp = n->data.Bd->comp; |
|
|
|
/* FIXME: -centered, etc. formatting. */ |
|
/* FIXME: does not respect -offset ??? */ |
|
|
|
if (MDOC_BLOCK == n->type) { |
if (MDOC_BLOCK == n->type) { |
bufcat_su(h, "margin-left", &su); |
comp = n->data.Bd->comp; |
for (nn = n; nn && ! comp; nn = nn->parent) { |
for (nn = n; nn && ! comp; nn = nn->parent) { |
if (MDOC_BLOCK != nn->type) |
if (MDOC_BLOCK != nn->type) |
continue; |
continue; |
Line 1145 mdoc_bd_pre(MDOC_ARGS) |
|
Line 1117 mdoc_bd_pre(MDOC_ARGS) |
|
if (nn->prev) |
if (nn->prev) |
break; |
break; |
} |
} |
if (comp) { |
if ( ! comp) |
PAIR_STYLE_INIT(&tag[0], h); |
print_otag(h, TAG_P, 0, NULL); |
print_otag(h, TAG_DIV, 1, tag); |
|
return(1); |
|
} |
|
SCALE_VS_INIT(&su, 1); |
|
bufcat_su(h, "margin-top", &su); |
|
PAIR_STYLE_INIT(&tag[0], h); |
|
print_otag(h, TAG_DIV, 1, tag); |
|
return(1); |
return(1); |
} |
} |
|
|
|
SCALE_HS_INIT(&su, 0); |
|
if (n->data.Bd->offs) |
|
a2offs(n->data.Bd->offs, &su); |
|
|
|
bufcat_su(h, "margin-left", &su); |
|
PAIR_STYLE_INIT(&tag[0], h); |
|
|
if (DISP_unfilled != n->data.Bd->type && |
if (DISP_unfilled != n->data.Bd->type && |
DISP_literal != n->data.Bd->type) |
DISP_literal != n->data.Bd->type) { |
|
PAIR_CLASS_INIT(&tag[1], "display"); |
|
print_otag(h, TAG_DIV, 2, tag); |
return(1); |
return(1); |
|
} |
|
|
PAIR_CLASS_INIT(&tag[0], "lit"); |
PAIR_CLASS_INIT(&tag[1], "lit display"); |
bufcat_style(h, "white-space", "pre"); |
print_otag(h, TAG_PRE, 2, tag); |
PAIR_STYLE_INIT(&tag[1], h); |
|
print_otag(h, TAG_DIV, 2, tag); |
|
|
|
for (nn = n->child; nn; nn = nn->next) { |
for (nn = n->child; nn; nn = nn->next) { |
print_mdoc_node(m, nn, h); |
print_mdoc_node(m, nn, h); |
Line 1196 mdoc_bd_pre(MDOC_ARGS) |
|
Line 1169 mdoc_bd_pre(MDOC_ARGS) |
|
} |
} |
if (nn->next && nn->next->line == nn->line) |
if (nn->next && nn->next->line == nn->line) |
continue; |
continue; |
print_text(h, "\n"); |
else if (nn->next) |
|
print_text(h, "\n"); |
|
|
h->flags |= HTML_NOSPACE; |
h->flags |= HTML_NOSPACE; |
} |
} |
|
|
Line 1665 mdoc_rv_pre(MDOC_ARGS) |
|
Line 1640 mdoc_rv_pre(MDOC_ARGS) |
|
struct htmlpair tag; |
struct htmlpair tag; |
struct tag *t; |
struct tag *t; |
|
|
print_otag(h, TAG_DIV, 0, NULL); |
if (n->prev) |
|
print_otag(h, TAG_BR, 0, NULL); |
|
|
print_text(h, "The"); |
print_text(h, "The"); |
|
|
for (nn = n->child; nn; nn = nn->next) { |
for (nn = n->child; nn; nn = nn->next) { |
Line 1861 mdoc_lb_pre(MDOC_ARGS) |
|
Line 1838 mdoc_lb_pre(MDOC_ARGS) |
|
{ |
{ |
struct htmlpair tag; |
struct htmlpair tag; |
|
|
if (SEC_LIBRARY == n->sec && MDOC_LINE & n->flags) |
if (SEC_LIBRARY == n->sec && MDOC_LINE & n->flags && n->prev) |
print_otag(h, TAG_DIV, 0, NULL); |
print_otag(h, TAG_BR, 0, NULL); |
|
|
PAIR_CLASS_INIT(&tag, "lib"); |
PAIR_CLASS_INIT(&tag, "lib"); |
print_otag(h, TAG_SPAN, 1, &tag); |
print_otag(h, TAG_SPAN, 1, &tag); |
return(1); |
return(1); |