aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2020-01-19 18:02:00 +0000
committerIngo Schwarze <schwarze@openbsd.org>2020-01-19 18:02:00 +0000
commit23f80e14e78282088dabbf1cfe358c07030dc9e7 (patch)
treea76006eb8db0481907b44a8fb28a37ebeb628fa0 /mdoc_html.c
parent66e8f935f05d1018898cee9e0c4ad713fc6b8673 (diff)
downloadmandoc-23f80e14e78282088dabbf1cfe358c07030dc9e7.tar.gz
mandoc-23f80e14e78282088dabbf1cfe358c07030dc9e7.tar.zst
mandoc-23f80e14e78282088dabbf1cfe358c07030dc9e7.zip
Introduce a new mdoc(7) macro .Tg ("tag") to explicitly mark a place
as defining a term. Please only use it when automatic tagging does not work. Manual page authors will not be required to add the new macro; using it remains optional. HTML output is still rudimentary in this version and will be polished later. Thanks to kn@ for reminding me that i have been considering since BSDCan 2014 whether something like this might be useful. Given that possibilities of making automatic tagging better are running out and there are still several situations where automatic tagging cannot do the job, i think the time is now ripe. Feedback and no objection from millert@; OK espie@ inoguchi@ kn@.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index 3d1e3ecf..a0582bf0 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,7 +1,7 @@
-/* $Id: mdoc_html.c,v 1.332 2019/12/11 18:44:05 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.333 2020/01/19 18:02:00 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2014-2019 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2014-2020 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -115,6 +115,7 @@ static int mdoc_ss_pre(MDOC_ARGS);
static int mdoc_st_pre(MDOC_ARGS);
static int mdoc_sx_pre(MDOC_ARGS);
static int mdoc_sy_pre(MDOC_ARGS);
+static int mdoc_tg_pre(MDOC_ARGS);
static int mdoc_va_pre(MDOC_ARGS);
static int mdoc_vt_pre(MDOC_ARGS);
static int mdoc_xr_pre(MDOC_ARGS);
@@ -241,6 +242,7 @@ static const struct mdoc_html_act mdoc_html_acts[MDOC_MAX - MDOC_Dd] = {
{mdoc__x_pre, mdoc__x_post}, /* %Q */
{mdoc__x_pre, mdoc__x_post}, /* %U */
{NULL, NULL}, /* Ta */
+ {mdoc_tg_pre, NULL}, /* Tg */
};
@@ -722,6 +724,16 @@ mdoc_xr_pre(MDOC_ARGS)
}
static int
+mdoc_tg_pre(MDOC_ARGS)
+{
+ char *id;
+
+ if ((id = html_make_id(n, 1)) != NULL)
+ print_otag(h, TAG_MARK, "i", id);
+ return 0;
+}
+
+static int
mdoc_ns_pre(MDOC_ARGS)
{