From abd3333b9f88880ecdafb72cd4a0af15d910f85e Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Mon, 29 May 2017 21:14:01 +0200 Subject: [PATCH] Add TOC to installation instructions This adds a Table of Contents to the installation instructions to improve the navigation within the document. I decided to use the command line to configure the TOC because there were problems with using just using an attribute entry in the document header. Specifically the insertion of the `header.asciidoc` into the resulting HTML file prevented the attribute entry approach from working. The TOC can now be inserted into any doc file using toc::[] --- INSTALL.asciidoc | 2 ++ scripts/asciidoc2html.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/INSTALL.asciidoc b/INSTALL.asciidoc index 651082bee..aaff04162 100644 --- a/INSTALL.asciidoc +++ b/INSTALL.asciidoc @@ -1,6 +1,8 @@ Installing qutebrowser ====================== +toc::[] + On Debian / Ubuntu ------------------ diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py index cfdc1b8d5..0e51dac10 100755 --- a/scripts/asciidoc2html.py +++ b/scripts/asciidoc2html.py @@ -184,7 +184,7 @@ class AsciiDoc: with open(modified_src, 'w+', encoding='utf-8') as final_version: final_version.write(title + "\n\n" + header + current_lines) - self.call(modified_src, dst, '--theme=qute') + self.call(modified_src, dst, '--theme=qute', '-a toc', '-a toc-placement=manual') def _build_website(self): """Prepare and build the website."""