diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2012-01-03 15:16:24 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2012-01-03 15:16:24 +0000 |
commit | d346448c959f7b9855c02917b358cfb0da2525e8 (patch) | |
tree | 1339709d2371873603f713f958f83cc8daa1a231 /man_html.c | |
parent | 484b430b59995e6ddf4b84461fdcc0c3a757addb (diff) | |
download | mandoc-d346448c959f7b9855c02917b358cfb0da2525e8.tar.gz mandoc-d346448c959f7b9855c02917b358cfb0da2525e8.tar.zst mandoc-d346448c959f7b9855c02917b358cfb0da2525e8.zip |
Add support for `OP', one of the extended man macros. This also requires
some man(7) changes to accomodate for the an-ext compatibility.
Diffstat (limited to 'man_html.c')
-rw-r--r-- | man_html.c | 53 |
1 files changed, 42 insertions, 11 deletions
@@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.85 2011/12/04 00:44:12 schwarze Exp $ */ +/* $Id: man_html.c,v 1.86 2012/01/03 15:16:24 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -58,26 +58,25 @@ static void print_man(MAN_ARGS); static void print_man_head(MAN_ARGS); static void print_man_nodelist(MAN_ARGS); static void print_man_node(MAN_ARGS); - static int a2width(const struct man_node *, struct roffsu *); - -static int man_alt_pre(MAN_ARGS); -static int man_br_pre(MAN_ARGS); -static int man_ign_pre(MAN_ARGS); -static int man_in_pre(MAN_ARGS); -static int man_literal_pre(MAN_ARGS); -static void man_root_post(MAN_ARGS); -static void man_root_pre(MAN_ARGS); static int man_B_pre(MAN_ARGS); static int man_HP_pre(MAN_ARGS); -static int man_I_pre(MAN_ARGS); static int man_IP_pre(MAN_ARGS); +static int man_I_pre(MAN_ARGS); +static int man_OP_pre(MAN_ARGS); static int man_PP_pre(MAN_ARGS); static int man_RS_pre(MAN_ARGS); static int man_SH_pre(MAN_ARGS); static int man_SM_pre(MAN_ARGS); static int man_SS_pre(MAN_ARGS); +static int man_alt_pre(MAN_ARGS); +static int man_br_pre(MAN_ARGS); +static int man_ign_pre(MAN_ARGS); +static int man_in_pre(MAN_ARGS); +static int man_literal_pre(MAN_ARGS); +static void man_root_post(MAN_ARGS); +static void man_root_pre(MAN_ARGS); static const struct htmlman mans[MAN_MAX] = { { man_br_pre, NULL }, /* br */ @@ -113,6 +112,7 @@ static const struct htmlman mans[MAN_MAX] = { { man_ign_pre, NULL }, /* AT */ { man_in_pre, NULL }, /* in */ { man_ign_pre, NULL }, /* ft */ + { man_OP_pre, NULL }, /* OP */ }; /* @@ -586,6 +586,37 @@ man_HP_pre(MAN_ARGS) /* ARGSUSED */ static int +man_OP_pre(MAN_ARGS) +{ + struct tag *tt; + struct htmlpair tag; + + print_text(h, "["); + h->flags |= HTML_NOSPACE; + PAIR_CLASS_INIT(&tag, "opt"); + tt = print_otag(h, TAG_SPAN, 1, &tag); + + if (NULL != (n = n->child)) { + print_otag(h, TAG_B, 0, NULL); + print_text(h, n->string); + } + + print_stagq(h, tt); + + if (NULL != n && NULL != n->next) { + print_otag(h, TAG_I, 0, NULL); + print_text(h, n->next->string); + } + + print_stagq(h, tt); + h->flags |= HTML_NOSPACE; + print_text(h, "]"); + return(0); +} + + +/* ARGSUSED */ +static int man_B_pre(MAN_ARGS) { |