diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2012-07-08 10:58:45 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2012-07-08 10:58:45 +0000 |
commit | bf0567e299d9d3dfa064e980d9629d042b4a9d0b (patch) | |
tree | 0dbc0b320e7399a8c3f6b36726fb4ac7f8dc7c2a /usr.bin/mandoc | |
parent | defc8ac065bba5c6ac50f857ffb0ce30e53df920 (diff) |
implement -Tman .Vt
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/mdoc_man.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mdoc_man.c b/usr.bin/mandoc/mdoc_man.c index ad0223a163e..82d50c4c56d 100644 --- a/usr.bin/mandoc/mdoc_man.c +++ b/usr.bin/mandoc/mdoc_man.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.14 2012/07/08 10:16:36 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.15 2012/07/08 10:58:44 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Ingo Schwarze <schwarze@openbsd.org> * @@ -59,6 +59,7 @@ static void post_percent(DECL_ARGS); static void post_pf(DECL_ARGS); static void post_sect(DECL_ARGS); static void post_sp(DECL_ARGS); +static void post_vt(DECL_ARGS); static int pre_ap(DECL_ARGS); static int pre_bd(DECL_ARGS); static int pre_bk(DECL_ARGS); @@ -77,6 +78,7 @@ static int pre_pp(DECL_ARGS); static int pre_sm(DECL_ARGS); static int pre_sp(DECL_ARGS); static int pre_sect(DECL_ARGS); +static int pre_vt(DECL_ARGS); static int pre_ux(DECL_ARGS); static int pre_xr(DECL_ARGS); static void print_word(struct mman *, const char *); @@ -129,7 +131,7 @@ static const struct manact manacts[MDOC_MAX + 1] = { }, /* Rv */ { NULL, NULL, NULL, NULL, NULL }, /* St */ { NULL, NULL, NULL, NULL, NULL }, /* _Va */ - { NULL, NULL, NULL, NULL, NULL }, /* _Vt */ + { NULL, pre_vt, post_vt, NULL, NULL }, /* Vt */ { NULL, pre_xr, NULL, NULL, NULL }, /* Xr */ { NULL, NULL, post_percent, NULL, NULL }, /* _%A */ { NULL, NULL, NULL, NULL, NULL }, /* _%B */ @@ -844,6 +846,33 @@ post_sp(DECL_ARGS) } static int +pre_vt(DECL_ARGS) +{ + + if (MDOC_SYNPRETTY & n->flags) { + mm->need_nl = 1; + print_word(mm, ".br"); + mm->need_nl = 1; + } + print_word(mm, "\\fI"); + mm->need_space = 0; + return(1); +} + +static void +post_vt(DECL_ARGS) +{ + + mm->need_space = 0; + print_word(mm, "\\fP"); + if (MDOC_SYNPRETTY & n->flags) { + mm->need_nl = 1; + print_word(mm, ".br"); + mm->need_nl = 1; + } +} + +static int pre_xr(DECL_ARGS) { |