summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/html.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2018-10-02 14:56:36 +0000
committerschwarze <schwarze@openbsd.org>2018-10-02 14:56:36 +0000
commit3327fa001cdea3a379b54bd358dba2db2bfce9cd (patch)
tree772c92ca4404ff7139b09bdd7dd121acc03adc20 /usr.bin/mandoc/html.c
parentmention INFO@openssh.com for sending SIGINFO (diff)
downloadwireguard-openbsd-3327fa001cdea3a379b54bd358dba2db2bfce9cd.tar.xz
wireguard-openbsd-3327fa001cdea3a379b54bd358dba2db2bfce9cd.zip
Add an option -T html -O toc to add a brief table of contents near
the top of HTML pages containing at least two non-standard sections. Suggested by Adam Kalisz and discussed with kristaps@ during EuroBSDCon 2018.
Diffstat (limited to 'usr.bin/mandoc/html.c')
-rw-r--r--usr.bin/mandoc/html.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c
index 0268171bb44..6c92488d912 100644
--- a/usr.bin/mandoc/html.c
+++ b/usr.bin/mandoc/html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: html.c,v 1.110 2018/10/02 12:32:55 schwarze Exp $ */
+/* $OpenBSD: html.c,v 1.111 2018/10/02 14:56:36 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -134,6 +134,8 @@ html_alloc(const struct manoutput *outopts)
h->base_includes = outopts->includes;
if (outopts->fragment)
h->oflags |= HTML_FRAGMENT;
+ if (outopts->toc)
+ h->oflags |= HTML_TOC;
mandoc_ohash_init(&id_unique, 4, 0);