From abd3333b9f88880ecdafb72cd4a0af15d910f85e Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Mon, 29 May 2017 21:14:01 +0200 Subject: [PATCH 1/4] 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.""" From 932b2814b03a0eae003dc30dbc906233d4efb20e Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Mon, 29 May 2017 21:20:17 +0200 Subject: [PATCH 2/4] Hide false header element from the TOC --- www/header.asciidoc | 2 +- www/qute.css | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/www/header.asciidoc b/www/header.asciidoc index ff5b26d9e..6b09ce21a 100644 --- a/www/header.asciidoc +++ b/www/header.asciidoc @@ -2,7 +2,7 @@
-

qutebrowser

+ qutebrowser A keyboard-driven browser.
diff --git a/www/qute.css b/www/qute.css index 9a47b8122..f8902f10e 100644 --- a/www/qute.css +++ b/www/qute.css @@ -44,9 +44,13 @@ p { text-align: right; } -#headline .text h1 { +#headline .text .heading-text { color: #1e89c6; + font-weight: bold; + font-size: 2em; border: none; + display: block; + white-space: pre-line; } #headline .text { From ad8cf371b8888e5c2c78fa022c13f14bbf652529 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Mon, 29 May 2017 21:28:04 +0200 Subject: [PATCH 3/4] Style table of contents properly for qute theme --- www/qute.css | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/www/qute.css b/www/qute.css index f8902f10e..fea2d8f78 100644 --- a/www/qute.css +++ b/www/qute.css @@ -224,6 +224,34 @@ table td { } } +#toc { + margin-bottom: 2.5em; +} + +#toctitle { + color: #0A396E; + font-size: 1.1em; + font-weight: bold; + margin-top: 1.0em; + margin-bottom: 0.1em; +} + +div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { + margin-top: 0; + margin-bottom: 0; +} +div.toclevel2 { + margin-left: 2em; + font-size: 0.9em; +} +div.toclevel3 { + margin-left: 4em; + font-size: 0.9em; +} +div.toclevel4 { + margin-left: 6em; + font-size: 0.9em; +} From 798cae51d4971a74fa5a7de4815b32d9871caad5 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Mon, 29 May 2017 23:15:22 +0200 Subject: [PATCH 4/4] Fix pylint issue --- scripts/asciidoc2html.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py index 0e51dac10..39695bd23 100755 --- a/scripts/asciidoc2html.py +++ b/scripts/asciidoc2html.py @@ -184,7 +184,8 @@ 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', '-a toc', '-a toc-placement=manual') + asciidoc_args = ['--theme=qute', '-a toc', '-a toc-placement=manual'] + self.call(modified_src, dst, *asciidoc_args) def _build_website(self): """Prepare and build the website."""