# HG changeset patch # User jjg # Date 1562801039 25200 # Node ID 45fc36beb0aab2df418faf9c8a2396541b5c6ed4 # Parent 56e8c0a3fe9a3f9f375399ba25de2e036612c1d9 8227416: Add a "Table Of Contents" to HTML version of man pages Reviewed-by: mchung diff -r 56e8c0a3fe9a -r 45fc36beb0aa make/Docs.gmk --- a/make/Docs.gmk Thu Jul 11 08:19:56 2019 +0900 +++ b/make/Docs.gmk Wed Jul 10 16:23:59 2019 -0700 @@ -626,7 +626,7 @@ FILTER := $(PANDOC_HTML_MANPAGE_FILTER), \ CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \ REPLACEMENTS := @@VERSION_SHORT@@ => $(VERSION_SHORT), \ - OPTIONS := -V include-before='$(SPECS_TOP)' -V include-after='$(SPECS_BOTTOM_1)', \ + OPTIONS := --toc -V include-before='$(SPECS_TOP)' -V include-after='$(SPECS_BOTTOM_1)', \ POST_PROCESS := $(TOOL_FIXUPPANDOC), \ EXTRA_DEPS := $(PANDOC_HTML_MANPAGE_FILTER) \ $(PANDOC_HTML_MANPAGE_FILTER_JAVASCRIPT), \ diff -r 56e8c0a3fe9a -r 45fc36beb0aa make/data/docs-resources/resources/jdk-default.css --- a/make/data/docs-resources/resources/jdk-default.css Thu Jul 11 08:19:56 2019 +0900 +++ b/make/data/docs-resources/resources/jdk-default.css Wed Jul 10 16:23:59 2019 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -162,3 +162,22 @@ font-style: italic; font-size: 80%; } + +nav#TOC { + border: 1px solid gray; + border-radius: 10px; + padding: 5px 10px; + margin-bottom: 15px; +} + +nav#TOC ul ul { + font-size:smaller; +} + +nav#TOC ul ul li { + display: inline-block +} + +nav#TOC ul ul li::before { + content: " \2022 " +} diff -r 56e8c0a3fe9a -r 45fc36beb0aa make/jdk/src/classes/build/tools/fixuppandoc/Main.java --- a/make/jdk/src/classes/build/tools/fixuppandoc/Main.java Thu Jul 11 08:19:56 2019 +0900 +++ b/make/jdk/src/classes/build/tools/fixuppandoc/Main.java Wed Jul 10 16:23:59 2019 -0700 @@ -81,6 +81,10 @@ * * Update the content string, to indicate it has been processed by this program. * + *

{@code

+ * + * Set attribute {@code title="Table Of Contents"} + * */ public class Main { /** @@ -273,6 +277,11 @@ } //
is not permitted within these elements allowMain = false; + if (name.equals("nav") && Objects.equals(attrs.get("id"), "TOC")) { + out.write(buffer.toString() + .replaceAll(">$", " title=\"Table Of Contents\">")); + buffer.setLength(0); + } break; case "body":