diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-09-20 17:48:13 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-09-20 17:48:13 +0000 |
commit | b323cfdd62e9fc21bd81db62a3eb2e4913007c6e (patch) | |
tree | efc1fe6ba5b898d6c9cbf8e9172592b903981c39 /html.c | |
parent | 396ee848349c2dbdf6a6a9d1504ccc8691b549ae (diff) | |
download | mandoc-b323cfdd62e9fc21bd81db62a3eb2e4913007c6e.tar.gz |
Bl -column in place for -Thtml.
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 28 |
1 files changed, 25 insertions, 3 deletions
@@ -1271,6 +1271,8 @@ mdoc_tbl_block_pre(MDOC_ARGS, int t, int w, int o, int c) struct htmlpair tag; switch (t) { + case (MDOC_Column): + /* FALLTHROUGH */ case (MDOC_Item): /* FALLTHROUGH */ case (MDOC_Ohang): @@ -1281,7 +1283,6 @@ mdoc_tbl_block_pre(MDOC_ARGS, int t, int w, int o, int c) break; } - if ( ! c && n->prev && n->prev->body->child) bufcat("padding-top: 1em;"); @@ -1316,6 +1317,15 @@ mdoc_tbl_head_pre(MDOC_ARGS, int t, int w) case (MDOC_Ohang): print_otag(h, TAG_DIV, 0, NULL); break; + case (MDOC_Column): + buffmt("min-width: %dem;", w); + bufcat("clear: none;"); + if (n->next && MDOC_HEAD == n->next->type) + bufcat("float: left;"); + tag.key = ATTR_STYLE; + tag.val = buf; + print_otag(h, TAG_DIV, 1, &tag); + break; default: buffmt("margin-left: -%dem;", w); bufcat("clear: left;"); @@ -1360,8 +1370,8 @@ mdoc_tbl_head_pre(MDOC_ARGS, int t, int w) static int mdoc_tbl_pre(MDOC_ARGS, int type) { - int i, w, o, c; - const struct mdoc_node *bl; + int i, w, o, c, wp; + const struct mdoc_node *bl, *nn; bl = n->parent->parent; if (MDOC_BLOCK != n->type) @@ -1372,16 +1382,28 @@ mdoc_tbl_pre(MDOC_ARGS, int type) assert(bl->args); w = o = c = 0; + wp = -1; for (i = 0; i < (int)bl->args->argc; i++) if (MDOC_Width == bl->args->argv[i].arg) { assert(bl->args->argv[i].sz); + wp = i; w = a2width(bl->args->argv[i].value[0]); } else if (MDOC_Offset == bl->args->argv[i].arg) { assert(bl->args->argv[i].sz); o = a2offs(bl->args->argv[i].value[0]); } else if (MDOC_Compact == bl->args->argv[i].arg) c = 1; + + if (MDOC_HEAD == n->type && MDOC_Column == type) { + nn = n->parent->child; + assert(nn && MDOC_HEAD == nn->type); + for (i = 0; nn && nn != n; nn = nn->next, i++) + /* Counter... */ ; + assert(nn); + if (wp >= 0 && i < (int)bl->args[wp].argv->sz) + w = a2width(bl->args->argv[wp].value[i]); + } switch (type) { case (MDOC_Enum): |