summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2018-10-02 14:56:37 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2018-10-02 14:56:37 +0000
commit827f7152ba8a7f47ae96ab0d6c79f89c8904682f (patch)
treeb2cc50016ac4e95d140d1284e180425cfbd0791d /usr.bin/mandoc/html.c
parentfa7d72a90665052508761833a5244d10b0ab7d64 (diff)
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);