From 0528debcf5b631def54405f2a163df53d1a9d2c8 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 18 Aug 2018 02:08:27 +0000 Subject: implement the GNU man-ext .SY/.YS (synopsis block) macro in man(7), used in most manual pages of the groff package --- man_html.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'man_html.c') diff --git a/man_html.c b/man_html.c index ff816bd2..12cf8ea7 100644 --- a/man_html.c +++ b/man_html.c @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.155 2018/08/17 20:33:37 schwarze Exp $ */ +/* $Id: man_html.c,v 1.156 2018/08/18 02:08:27 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze @@ -61,6 +61,7 @@ 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_SY_pre(MAN_ARGS); static int man_UR_pre(MAN_ARGS); static int man_alt_pre(MAN_ARGS); static int man_ign_pre(MAN_ARGS); @@ -101,6 +102,8 @@ static const struct man_html_act man_html_acts[MAN_MAX - MAN_TH] = { { man_ign_pre, NULL }, /* PD */ { man_ign_pre, NULL }, /* AT */ { man_in_pre, NULL }, /* in */ + { man_SY_pre, NULL }, /* SY */ + { NULL, NULL }, /* YS */ { man_OP_pre, NULL }, /* OP */ { NULL, NULL }, /* EX */ { NULL, NULL }, /* EE */ @@ -621,6 +624,27 @@ man_RS_pre(MAN_ARGS) return 1; } +static int +man_SY_pre(MAN_ARGS) +{ + switch (n->type) { + case ROFFT_BLOCK: + print_otag(h, TAG_TABLE, "c", "Nm"); + print_otag(h, TAG_TR, ""); + break; + case ROFFT_HEAD: + print_otag(h, TAG_TD, ""); + print_otag(h, TAG_CODE, "cT", "Nm"); + break; + case ROFFT_BODY: + print_otag(h, TAG_TD, ""); + break; + default: + abort(); + } + return 1; +} + static int man_UR_pre(MAN_ARGS) { -- cgit v1.2.3-56-ge451