summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-12-17 08:17:40 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-12-17 08:17:40 +0000
commitcc7f2a2dc0a3200e8f8dd766ff0eddd6a3532388 (patch)
treef560b2a0ef6e0cb59d3b9b054b3f073cdb57d226 /mdoc_html.c
parente475285cd277f9da6cc63e7cdf31e74385a3ccc1 (diff)
downloadmandoc-cc7f2a2dc0a3200e8f8dd766ff0eddd6a3532388.tar.gz
mandoc-cc7f2a2dc0a3200e8f8dd766ff0eddd6a3532388.tar.zst
mandoc-cc7f2a2dc0a3200e8f8dd766ff0eddd6a3532388.zip
Have synopsis_pre() in -Thtml emit P or BR, not DIVs.
Banish header and footer TABLE styling to example.style.css.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c66
1 files changed, 23 insertions, 43 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index 15c1cc7a..8d5c00c7 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.124 2010/12/17 01:02:00 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.125 2010/12/17 08:17:40 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -299,21 +299,15 @@ a2width(const char *p, struct roffsu *su)
static void
synopsis_pre(struct html *h, const struct mdoc_node *n)
{
- struct roffsu su;
- struct htmlpair tag;
if (NULL == n->prev || ! (MDOC_SYNPRETTY & n->flags))
return;
- SCALE_VS_INIT(&su, 1);
- bufcat_su(h, "margin-top", &su);
- PAIR_STYLE_INIT(&tag, h);
-
if (n->prev->tok == n->tok &&
MDOC_Fo != n->tok &&
MDOC_Ft != n->tok &&
MDOC_Fn != n->tok) {
- print_otag(h, TAG_DIV, 0, NULL);
+ print_otag(h, TAG_BR, 0, NULL);
return;
}
@@ -327,16 +321,16 @@ synopsis_pre(struct html *h, const struct mdoc_node *n)
case (MDOC_In):
/* FALLTHROUGH */
case (MDOC_Vt):
- print_otag(h, TAG_DIV, 1, &tag);
+ print_otag(h, TAG_P, 0, NULL);
break;
case (MDOC_Ft):
if (MDOC_Fn != n->tok && MDOC_Fo != n->tok) {
- print_otag(h, TAG_DIV, 1, &tag);
+ print_otag(h, TAG_P, 0, NULL);
break;
}
/* FALLTHROUGH */
default:
- print_otag(h, TAG_DIV, 0, NULL);
+ print_otag(h, TAG_BR, 0, NULL);
break;
}
}
@@ -463,37 +457,31 @@ print_mdoc_node(MDOC_ARGS)
}
}
-
/* ARGSUSED */
static void
mdoc_root_post(MDOC_ARGS)
{
- struct htmlpair tag[3];
+ struct htmlpair tag[2];
struct tag *t, *tt;
char b[DATESIZ];
time2a(m->date, b, DATESIZ);
- PAIR_CLASS_INIT(&tag[0], "footer");
- bufcat_style(h, "width", "100%");
- PAIR_STYLE_INIT(&tag[1], h);
- PAIR_SUMMARY_INIT(&tag[2], "footer");
+ PAIR_CLASS_INIT(&tag[0], "foot");
+ PAIR_SUMMARY_INIT(&tag[1], "Document Footer");
+ t = print_otag(h, TAG_TABLE, 2, tag);
- t = print_otag(h, TAG_TABLE, 3, tag);
tt = print_otag(h, TAG_TR, 0, NULL);
- bufinit(h);
- bufcat_style(h, "width", "50%");
- PAIR_STYLE_INIT(&tag[0], h);
+ PAIR_CLASS_INIT(&tag[0], "foot-date");
print_otag(h, TAG_TD, 1, tag);
+
print_text(h, b);
print_stagq(h, tt);
- bufinit(h);
- bufcat_style(h, "width", "50%");
- bufcat_style(h, "text-align", "right");
- PAIR_STYLE_INIT(&tag[0], h);
+ PAIR_CLASS_INIT(&tag[0], "foot-os");
print_otag(h, TAG_TD, 1, tag);
+
print_text(h, m->os);
print_tagq(h, t);
}
@@ -517,36 +505,27 @@ mdoc_root_pre(MDOC_ARGS)
snprintf(title, BUFSIZ - 1, "%s(%s)", m->title, m->msec);
- PAIR_CLASS_INIT(&tag[0], "header");
- bufcat_style(h, "width", "100%");
- PAIR_STYLE_INIT(&tag[1], h);
- PAIR_SUMMARY_INIT(&tag[2], "header");
-
- t = print_otag(h, TAG_TABLE, 3, tag);
+ PAIR_CLASS_INIT(&tag[0], "head");
+ PAIR_SUMMARY_INIT(&tag[1], "Document Header");
+ t = print_otag(h, TAG_TABLE, 2, tag);
tt = print_otag(h, TAG_TR, 0, NULL);
- bufinit(h);
- bufcat_style(h, "width", "10%");
- PAIR_STYLE_INIT(&tag[0], h);
+ PAIR_CLASS_INIT(&tag[0], "head-ltitle");
print_otag(h, TAG_TD, 1, tag);
+
print_text(h, title);
print_stagq(h, tt);
- bufinit(h);
- bufcat_style(h, "text-align", "center");
- bufcat_style(h, "white-space", "nowrap");
- bufcat_style(h, "width", "80%");
- PAIR_STYLE_INIT(&tag[0], h);
+ PAIR_CLASS_INIT(&tag[0], "head-vol");
print_otag(h, TAG_TD, 1, tag);
+
print_text(h, b);
print_stagq(h, tt);
- bufinit(h);
- bufcat_style(h, "text-align", "right");
- bufcat_style(h, "width", "10%");
- PAIR_STYLE_INIT(&tag[0], h);
+ PAIR_CLASS_INIT(&tag[0], "head-rtitle");
print_otag(h, TAG_TD, 1, tag);
+
print_text(h, title);
print_tagq(h, t);
return(1);
@@ -1196,6 +1175,7 @@ mdoc_bd_pre(MDOC_ARGS)
}
if (nn->next && nn->next->line == nn->line)
continue;
+
print_text(h, "\n");
h->flags |= HTML_NOSPACE;
}