summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-01-19 15:27:26 +0000
committerschwarze <schwarze@openbsd.org>2017-01-19 15:27:26 +0000
commitc7402a19d0801e05f4312cdb6ee12130ce32eb85 (patch)
treec180ae633b7595b20cb8ad84256e2826e7592f05
parentExtend struct platform with MP control functions, and add bootstrap code (diff)
downloadwireguard-openbsd-c7402a19d0801e05f4312cdb6ee12130ce32eb85.tar.xz
wireguard-openbsd-c7402a19d0801e05f4312cdb6ee12130ce32eb85.zip
Clean up CSS rules for sections and paragraphs.
Start using real macro names for CSS classes.
-rw-r--r--usr.bin/mandoc/html.c6
-rw-r--r--usr.bin/mandoc/man_html.c22
-rw-r--r--usr.bin/mandoc/mdoc_html.c18
3 files changed, 20 insertions, 26 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c
index e893103f335..16cc7ca6732 100644
--- a/usr.bin/mandoc/html.c
+++ b/usr.bin/mandoc/html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: html.c,v 1.67 2017/01/19 01:00:11 schwarze Exp $ */
+/* $OpenBSD: html.c,v 1.68 2017/01/19 15:27:26 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -180,7 +180,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)
@@ -767,7 +767,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);
}
diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c
index af77538e630..c17ccfe4e9a 100644
--- a/usr.bin/mandoc/man_html.c
+++ b/usr.bin/mandoc/man_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_html.c,v 1.79 2017/01/19 13:34:59 schwarze Exp $ */
+/* $OpenBSD: man_html.c,v 1.80 2017/01/19 15:27:26 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -160,7 +160,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);
}
@@ -196,9 +200,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);
@@ -252,9 +253,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:
@@ -351,12 +349,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;
}
@@ -430,12 +427,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;
}
@@ -508,7 +504,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;
}
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index a41ce23cbb8..bec67201266 100644
--- a/usr.bin/mandoc/mdoc_html.c
+++ b/usr.bin/mandoc/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_html.c,v 1.127 2017/01/19 13:34:59 schwarze Exp $ */
+/* $OpenBSD: mdoc_html.c,v 1.128 2017/01/19 15:27:26 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -311,7 +311,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);
}
@@ -517,7 +519,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)
@@ -528,10 +529,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;
}
@@ -541,17 +542,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;
}