From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (schwarze@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id q6BGJ9np010591 for ; Wed, 11 Jul 2012 12:19:09 -0400 (EDT) Received: (from schwarze@localhost) by krisdoz.my.domain (8.14.5/8.14.3/Submit) id q6BGJ9gK014166; Wed, 11 Jul 2012 12:19:09 -0400 (EDT) Date: Wed, 11 Jul 2012 12:19:09 -0400 (EDT) Message-Id: <201207111619.q6BGJ9gK014166@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: basic implementation of -Tman .Bl -column using tbl(7); OpenBSD X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- basic implementation of -Tman .Bl -column using tbl(7); OpenBSD rev. 1.31 Modified Files: -------------- mdocml: mdoc_man.c Revision Data ------------- Index: mdoc_man.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_man.c,v retrieving revision 1.32 retrieving revision 1.33 diff -Lmdoc_man.c -Lmdoc_man.c -u -p -r1.32 -r1.33 --- mdoc_man.c +++ mdoc_man.c @@ -754,9 +754,24 @@ post_bk(DECL_ARGS) static int pre_bl(DECL_ARGS) { + size_t icol; - if (LIST_enum == n->norm->Bl.type) + switch (n->norm->Bl.type) { + case (LIST_enum): n->norm->Bl.count = 0; + return(1); + case (LIST_column): + break; + default: + return(1); + } + + outflags |= MMAN_nl; + print_word(".TS"); + outflags |= MMAN_nl; + for (icol = 0; icol < n->norm->Bl.ncols; icol++) + print_word("l"); + print_word("."); return(1); } @@ -764,9 +779,18 @@ static void post_bl(DECL_ARGS) { - outflags |= MMAN_br; - if (LIST_enum == n->norm->Bl.type) + switch (n->norm->Bl.type) { + case (LIST_enum): n->norm->Bl.count = 0; + break; + case (LIST_column): + outflags |= MMAN_nl; + print_word(".TE"); + break; + default: + break; + } + outflags |= MMAN_br; } static int @@ -1075,8 +1099,10 @@ post_it(DECL_ARGS) { const struct mdoc_node *bln; - if (MDOC_HEAD == n->type) { - bln = n->parent->parent; + bln = n->parent->parent; + + switch (n->type) { + case (MDOC_HEAD): switch (bln->norm->Bl.type) { case (LIST_diag): outflags &= ~MMAN_spc; @@ -1088,6 +1114,16 @@ post_it(DECL_ARGS) default: break; } + break; + case (MDOC_BODY): + if (LIST_column == bln->norm->Bl.type && + NULL != n->next) { + putchar('\t'); + outflags &= ~MMAN_spc; + } + break; + default: + break; } } -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv