-/* $Id: man_html.c,v 1.45 2010/07/23 12:27:28 kristaps Exp $ */
+/* $Id: man_html.c,v 1.53 2010/12/15 17:19:41 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
{ man_alt_pre, NULL }, /* IR */
{ man_alt_pre, NULL }, /* RI */
{ NULL, NULL }, /* na */
- { NULL, NULL }, /* i */
{ man_br_pre, NULL }, /* sp */
{ man_literal_pre, NULL }, /* nf */
{ man_literal_pre, NULL }, /* fi */
- { NULL, NULL }, /* r */
{ NULL, NULL }, /* RE */
{ man_RS_pre, NULL }, /* RS */
{ man_ign_pre, NULL }, /* DT */
{ man_ign_pre, NULL }, /* UC */
{ man_ign_pre, NULL }, /* PD */
- { man_br_pre, NULL }, /* Sp */
- { man_literal_pre, NULL }, /* Vb */
- { man_literal_pre, NULL }, /* Ve */
{ man_ign_pre, NULL }, /* AT */
{ man_in_pre, NULL }, /* in */
+ { man_ign_pre, NULL }, /* ft */
};
print_man(MAN_ARGS)
{
struct tag *t;
- struct htmlpair tag;
t = print_otag(h, TAG_HEAD, 0, NULL);
-
print_man_head(m, n, mh, h);
print_tagq(h, t);
- t = print_otag(h, TAG_BODY, 0, NULL);
-
- tag.key = ATTR_CLASS;
- tag.val = "body";
- print_otag(h, TAG_DIV, 1, &tag);
+ t = print_otag(h, TAG_BODY, 0, NULL);
print_man_nodelist(m, n, mh, h);
-
print_tagq(h, t);
}
SCALE_VS_INIT(&su, 1);
- switch (n->tok) {
- case (MAN_Sp):
- SCALE_VS_INIT(&su, 0.5);
- break;
- case (MAN_sp):
+ if (MAN_sp == n->tok) {
if (n->child)
a2roffsu(n->child->string, &su, SCALE_VS);
- break;
- default:
+ } else
su.scale = 0;
- break;
- }
bufcat_su(h, "height", &su);
PAIR_STYLE_INIT(&tag, h);
struct roffsu su;
int i;
- if (MAN_BLOCK != n->type)
+ if (MAN_BODY == n->type)
return(1);
+ if (MAN_HEAD == n->type)
+ return(0);
i = 0;
PAIR_STYLE_INIT(&tag, h);
print_otag(h, TAG_DIV, i, &tag);
+
return(1);
}
man_literal_pre(MAN_ARGS)
{
- switch (n->tok) {
- case (MAN_nf):
- /* FALLTHROUGH */
- case (MAN_Vb):
+ if (MAN_nf == n->tok) {
print_otag(h, TAG_BR, 0, NULL);
mh->fl |= MANH_LITERAL;
- return(MAN_Vb != n->tok);
- default:
+ } else
mh->fl &= ~MANH_LITERAL;
- break;
- }
return(1);
}