summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2011-10-09 22:10:53 +0000
committerIngo Schwarze <schwarze@openbsd.org>2011-10-09 22:10:53 +0000
commit14297a71223fc5ff079a17f339ddbf603eaca3bf (patch)
tree61a5348244d62a4abb46ed155bc58f9a5f24ab60
parentf8c77ebc9cfb18899e0979444a400bc386212579 (diff)
downloadmandoc-14297a71223fc5ff079a17f339ddbf603eaca3bf.tar.gz
Always print <table> column widths in -T[x]html;
if desired, they can be overridden in the CSS file. Suggested by kristaps@, and i always like to simplify code.
-rw-r--r--man_html.c52
-rw-r--r--mdoc_html.c54
2 files changed, 34 insertions, 72 deletions
diff --git a/man_html.c b/man_html.c
index 050bc84a..f02201da 100644
--- a/man_html.c
+++ b/man_html.c
@@ -309,15 +309,12 @@ man_root_pre(MAN_ARGS)
PAIR_SUMMARY_INIT(&tag[0], "Document Header");
PAIR_CLASS_INIT(&tag[1], "head");
- if (NULL == h->style) {
- PAIR_INIT(&tag[2], ATTR_WIDTH, "100%");
- t = print_otag(h, TAG_TABLE, 3, tag);
- 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);
- } else
- t = print_otag(h, TAG_TABLE, 2, tag);
+ PAIR_INIT(&tag[2], ATTR_WIDTH, "100%");
+ t = print_otag(h, TAG_TABLE, 3, tag);
+ 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_TBODY, 0, NULL);
@@ -325,27 +322,18 @@ man_root_pre(MAN_ARGS)
PAIR_CLASS_INIT(&tag[0], "head-ltitle");
print_otag(h, TAG_TD, 1, tag);
-
print_text(h, title);
print_stagq(h, tt);
PAIR_CLASS_INIT(&tag[0], "head-vol");
- if (NULL == h->style) {
- PAIR_INIT(&tag[1], ATTR_ALIGN, "center");
- print_otag(h, TAG_TD, 2, tag);
- } else
- print_otag(h, TAG_TD, 1, tag);
-
+ PAIR_INIT(&tag[1], ATTR_ALIGN, "center");
+ print_otag(h, TAG_TD, 2, tag);
print_text(h, b);
print_stagq(h, tt);
PAIR_CLASS_INIT(&tag[0], "head-rtitle");
- if (NULL == h->style) {
- PAIR_INIT(&tag[1], ATTR_ALIGN, "right");
- print_otag(h, TAG_TD, 2, tag);
- } else
- print_otag(h, TAG_TD, 1, tag);
-
+ PAIR_INIT(&tag[1], ATTR_ALIGN, "right");
+ print_otag(h, TAG_TD, 2, tag);
print_text(h, title);
print_tagq(h, t);
}
@@ -360,14 +348,11 @@ man_root_post(MAN_ARGS)
PAIR_SUMMARY_INIT(&tag[0], "Document Footer");
PAIR_CLASS_INIT(&tag[1], "foot");
- if (NULL == h->style) {
- PAIR_INIT(&tag[2], ATTR_WIDTH, "100%");
- t = print_otag(h, TAG_TABLE, 3, tag);
- PAIR_INIT(&tag[0], ATTR_WIDTH, "50%");
- print_otag(h, TAG_COL, 1, tag);
- print_otag(h, TAG_COL, 1, tag);
- } else
- t = print_otag(h, TAG_TABLE, 2, tag);
+ PAIR_INIT(&tag[2], ATTR_WIDTH, "100%");
+ t = print_otag(h, TAG_TABLE, 3, tag);
+ PAIR_INIT(&tag[0], ATTR_WIDTH, "50%");
+ print_otag(h, TAG_COL, 1, tag);
+ print_otag(h, TAG_COL, 1, tag);
tt = print_otag(h, TAG_TR, 0, NULL);
@@ -378,11 +363,8 @@ man_root_post(MAN_ARGS)
print_stagq(h, tt);
PAIR_CLASS_INIT(&tag[0], "foot-os");
- if (NULL == h->style) {
- PAIR_INIT(&tag[1], ATTR_ALIGN, "right");
- print_otag(h, TAG_TD, 2, tag);
- } else
- print_otag(h, TAG_TD, 1, tag);
+ PAIR_INIT(&tag[1], ATTR_ALIGN, "right");
+ print_otag(h, TAG_TD, 2, tag);
if (m->source)
print_text(h, m->source);
diff --git a/mdoc_html.c b/mdoc_html.c
index b51adc45..0701f22d 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -497,14 +497,11 @@ mdoc_root_post(MDOC_ARGS)
PAIR_SUMMARY_INIT(&tag[0], "Document Footer");
PAIR_CLASS_INIT(&tag[1], "foot");
- if (NULL == h->style) {
- PAIR_INIT(&tag[2], ATTR_WIDTH, "100%");
- t = print_otag(h, TAG_TABLE, 3, tag);
- PAIR_INIT(&tag[0], ATTR_WIDTH, "50%");
- print_otag(h, TAG_COL, 1, tag);
- print_otag(h, TAG_COL, 1, tag);
- } else
- t = print_otag(h, TAG_TABLE, 2, tag);
+ PAIR_INIT(&tag[2], ATTR_WIDTH, "100%");
+ t = print_otag(h, TAG_TABLE, 3, tag);
+ PAIR_INIT(&tag[0], ATTR_WIDTH, "50%");
+ print_otag(h, TAG_COL, 1, tag);
+ print_otag(h, TAG_COL, 1, tag);
t = print_otag(h, TAG_TBODY, 0, NULL);
@@ -512,17 +509,12 @@ mdoc_root_post(MDOC_ARGS)
PAIR_CLASS_INIT(&tag[0], "foot-date");
print_otag(h, TAG_TD, 1, tag);
-
print_text(h, m->date);
print_stagq(h, tt);
PAIR_CLASS_INIT(&tag[0], "foot-os");
- if (NULL == h->style) {
- PAIR_INIT(&tag[1], ATTR_ALIGN, "right");
- print_otag(h, TAG_TD, 2, tag);
- } else
- print_otag(h, TAG_TD, 1, tag);
-
+ PAIR_INIT(&tag[1], ATTR_ALIGN, "right");
+ print_otag(h, TAG_TD, 2, tag);
print_text(h, m->os);
print_tagq(h, t);
}
@@ -548,15 +540,12 @@ mdoc_root_pre(MDOC_ARGS)
PAIR_SUMMARY_INIT(&tag[0], "Document Header");
PAIR_CLASS_INIT(&tag[1], "head");
- if (NULL == h->style) {
- PAIR_INIT(&tag[2], ATTR_WIDTH, "100%");
- t = print_otag(h, TAG_TABLE, 3, tag);
- 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);
- } else
- t = print_otag(h, TAG_TABLE, 2, tag);
+ PAIR_INIT(&tag[2], ATTR_WIDTH, "100%");
+ t = print_otag(h, TAG_TABLE, 3, tag);
+ 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_TBODY, 0, NULL);
@@ -564,27 +553,18 @@ mdoc_root_pre(MDOC_ARGS)
PAIR_CLASS_INIT(&tag[0], "head-ltitle");
print_otag(h, TAG_TD, 1, tag);
-
print_text(h, title);
print_stagq(h, tt);
PAIR_CLASS_INIT(&tag[0], "head-vol");
- if (NULL == h->style) {
- PAIR_INIT(&tag[1], ATTR_ALIGN, "center");
- print_otag(h, TAG_TD, 2, tag);
- } else
- print_otag(h, TAG_TD, 1, tag);
-
+ PAIR_INIT(&tag[1], ATTR_ALIGN, "center");
+ print_otag(h, TAG_TD, 2, tag);
print_text(h, b);
print_stagq(h, tt);
PAIR_CLASS_INIT(&tag[0], "head-rtitle");
- if (NULL == h->style) {
- PAIR_INIT(&tag[1], ATTR_ALIGN, "right");
- print_otag(h, TAG_TD, 2, tag);
- } else
- print_otag(h, TAG_TD, 1, tag);
-
+ PAIR_INIT(&tag[1], ATTR_ALIGN, "right");
+ print_otag(h, TAG_TD, 2, tag);
print_text(h, title);
print_tagq(h, t);
return(1);