aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-10-02 14:56:47 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-10-02 14:56:47 +0000
commitcc61d00ed522f99c9f1a34fcc6add2d202942885 (patch)
treebd523708468309e4a2f716485ca75294c2822d66 /html.c
parentdfc72caad2158b1226363fe39e7bfa995ef68f78 (diff)
downloadmandoc-cc61d00ed522f99c9f1a34fcc6add2d202942885.tar.gz
mandoc-cc61d00ed522f99c9f1a34fcc6add2d202942885.tar.zst
mandoc-cc61d00ed522f99c9f1a34fcc6add2d202942885.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 'html.c')
-rw-r--r--html.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/html.c b/html.c
index 5078864f..0d6687fb 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.240 2018/10/02 12:33:37 schwarze Exp $ */
+/* $Id: html.c,v 1.241 2018/10/02 14:56:47 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -136,6 +136,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);