diff options
-rw-r--r-- | html.c | 4 | ||||
-rw-r--r-- | man_html.c | 20 | ||||
-rw-r--r-- | mandoc.css | 20 | ||||
-rw-r--r-- | mdoc_html.c | 16 |
4 files changed, 30 insertions, 30 deletions
@@ -182,7 +182,7 @@ print_gen_head(struct html *h) print_endline(h); print_text(h, "table.head td { width: 33%; }"); print_endline(h); - print_text(h, "div.spacer { margin: 1em 0; }"); + print_text(h, "div.Pp { margin: 1ex 0ex; }"); print_tagq(h, t); if (h->style) @@ -769,7 +769,7 @@ print_paragraph(struct html *h) { struct tag *t; - t = print_otag(h, TAG_DIV, "c", "spacer"); + t = print_otag(h, TAG_DIV, "c", "Pp"); print_tagq(h, t); } @@ -162,7 +162,11 @@ html_man(void *arg, const struct roff_man *man) print_otag(h, TAG_BODY, ""); } - print_man_nodelist(&man->meta, man->first, &mh, h); + man_root_pre(&man->meta, man->first, &mh, h); + t = print_otag(h, TAG_DIV, "c", "manual-text"); + print_man_nodelist(&man->meta, man->first->child, &mh, h); + print_tagq(h, t); + man_root_post(&man->meta, man->first, &mh, h); print_tagq(h, NULL); } @@ -198,9 +202,6 @@ print_man_node(MAN_ARGS) t = h->tags.head; switch (n->type) { - case ROFFT_ROOT: - man_root_pre(man, n, mh, h); - break; case ROFFT_TEXT: if ('\0' == *n->string) { print_paragraph(h); @@ -254,9 +255,6 @@ print_man_node(MAN_ARGS) print_stagq(h, t); switch (n->type) { - case ROFFT_ROOT: - man_root_post(man, n, mh, h); - break; case ROFFT_EQN: break; default: @@ -353,12 +351,11 @@ man_SH_pre(MAN_ARGS) { if (n->type == ROFFT_BLOCK) { mh->fl &= ~MANH_LITERAL; - print_otag(h, TAG_DIV, "c", "section"); return 1; } else if (n->type == ROFFT_BODY) return 1; - print_otag(h, TAG_H1, ""); + print_otag(h, TAG_H1, "c", "Sh"); return 1; } @@ -432,12 +429,11 @@ man_SS_pre(MAN_ARGS) { if (n->type == ROFFT_BLOCK) { mh->fl &= ~MANH_LITERAL; - print_otag(h, TAG_DIV, "c", "subsection"); return 1; } else if (n->type == ROFFT_BODY) return 1; - print_otag(h, TAG_H2, ""); + print_otag(h, TAG_H2, "c", "Ss"); return 1; } @@ -510,7 +506,7 @@ man_HP_pre(MAN_ARGS) sui.scale = -sum.scale; print_bvspace(h, n); - print_otag(h, TAG_DIV, "csului", "spacer", &sum, &sui); + print_otag(h, TAG_DIV, "csului", "Pp", &sum, &sui); return 1; } @@ -40,17 +40,23 @@ td.foot-date { width: 50%; } td.foot-os { width: 50%; text-align: right; } +/* Sections and paragraphs. */ + +div.manual-text { + margin-left: 5ex; } +h1.Sh { margin-top: 2ex; + margin-bottom: 1ex; + margin-left: -4ex; + font-size: 110%; } +h2.Ss { margin-top: 2ex; + margin-bottom: 1ex; + margin-left: -2ex; + font-size: 105%; } +div.Pp { margin: 1ex 0ex; } -h1 { margin-bottom: 1ex; font-size: 110% } -div.section > h1 { margin-left: -4ex; } /* Section header (Sh, SH). */ -h2 { margin-bottom: 1ex; font-size: 105%; margin-left: -2ex; } /* Sub-section header (Ss, SS). */ -p { } /* Paragraph: Pp, Lp. */ blockquote { margin-left: 5ex; margin-top: 0ex; margin-bottom: 0ex; } /* D1. */ -div.section { margin-bottom: 2ex; margin-left: 5ex; } /* Sections (Sh, SH). */ -div.subsection { } /* Sub-sections (Ss, SS). */ table.synopsis { } /* SYNOPSIS section table. */ -div.spacer { margin: 1em 0; } /* General font modes. */ diff --git a/mdoc_html.c b/mdoc_html.c index d90e6447..74337340 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -313,7 +313,9 @@ html_mdoc(void *arg, const struct roff_man *mdoc) } mdoc_root_pre(&mdoc->meta, mdoc->first->child, h); + t = print_otag(h, TAG_DIV, "c", "manual-text"); print_mdoc_nodelist(&mdoc->meta, mdoc->first->child, h); + print_tagq(h, t); mdoc_root_post(&mdoc->meta, mdoc->first->child, h); print_tagq(h, NULL); } @@ -519,7 +521,6 @@ mdoc_sh_pre(MDOC_ARGS) switch (n->type) { case ROFFT_BLOCK: - print_otag(h, TAG_DIV, "c", "section"); return 1; case ROFFT_BODY: if (n->sec == SEC_AUTHORS) @@ -530,10 +531,10 @@ mdoc_sh_pre(MDOC_ARGS) } if ((id = make_id(n)) != NULL) { - print_otag(h, TAG_H1, "i", id); + print_otag(h, TAG_H1, "ci", "Sh", id); free(id); } else - print_otag(h, TAG_H1, ""); + print_otag(h, TAG_H1, "c", "Sh"); return 1; } @@ -543,17 +544,14 @@ mdoc_ss_pre(MDOC_ARGS) { char *id; - if (n->type == ROFFT_BLOCK) { - print_otag(h, TAG_DIV, "c", "subsection"); - return 1; - } else if (n->type == ROFFT_BODY) + if (n->type != ROFFT_HEAD) return 1; if ((id = make_id(n)) != NULL) { - print_otag(h, TAG_H2, "i", id); + print_otag(h, TAG_H2, "ci", "Ss", id); free(id); } else - print_otag(h, TAG_H2, ""); + print_otag(h, TAG_H2, "c", "Ss"); return 1; } |