From f8e25d8b4f7c0eaadd37dcf804564590037f13e3 Mon Sep 17 00:00:00 2001
From: Topi Reinio <topi.reinio@digia.com>
Date: Tue, 21 Oct 2014 12:45:31 +0200
Subject: [PATCH] Doc: Add sidebar content used in the qt.io online template

As part of the new online style, each page has a sidebar with
links to common topics - the same content as on the Qt reference
documentation (index) page.

Switch the order of the topics on the sidebar, based on Google
Analytics feedback. Most-used links are from the 'Reference'
category, so raise that one to the top.

This commit adds the raw .html file into /style, which is then
loaded dynamically by the template code.

Task-number: QTBUG-42086
Change-Id: I69add8ca75c00bb1ff7039adf34194c2c673885d
Reviewed-by: Martin Smith <martin.smith@digia.com>
---
 doc/config/qtdoc.qdocconf         |  3 ++
 doc/config/style/qt5-sidebar.html | 50 +++++++++++++++++++++++++++++++
 doc/src/index.qdoc                | 34 ++++++++++-----------
 3 files changed, 70 insertions(+), 17 deletions(-)
 create mode 100644 doc/config/style/qt5-sidebar.html

diff --git a/doc/config/qtdoc.qdocconf b/doc/config/qtdoc.qdocconf
index 2bc33f99..5109a436 100644
--- a/doc/config/qtdoc.qdocconf
+++ b/doc/config/qtdoc.qdocconf
@@ -99,3 +99,6 @@ qhp.QtDoc.subprojects.examples.sortPages = true
 # Add an image used in example manifests to qhp
 HTML.extraimages             += images/qt-codesample.png
 qhp.QtDoc.extraFiles         += images/qt-codesample.png
+
+# Add an .html file with sidebar content, used in the online style
+HTML.stylesheets             += style/qt5-sidebar.html
diff --git a/doc/config/style/qt5-sidebar.html b/doc/config/style/qt5-sidebar.html
new file mode 100644
index 00000000..2315cffd
--- /dev/null
+++ b/doc/config/style/qt5-sidebar.html
@@ -0,0 +1,50 @@
+<div class="sectionlist normallist">
+    <div class="heading">
+        <a name="reference"></a>
+        <h2 id="reference">Reference</h2>
+    </div>
+    <div class="indexboxcont indexboxbar">
+        <ul>
+            <li><a href="classes.html">All Qt C++ Classes</a></li>
+            <li><a href="qmltypes.html">All QML Types</a></li>
+            <li><a href="qtmodules.html">All Qt Modules</a></li>
+            <li><a href="../qtcreator/index.html">Qt Creator Manual</a></li>
+        </ul>
+        <ul>
+            <li><a href="reference-overview.html">All Qt Reference Documentation</a></li>
+        </ul>
+    </div>
+</div>
+<div class="sectionlist normallist">
+    <div class="heading">
+        <a name="getting-started"></a>
+        <h2 id="getting-started">Getting Started</h2>
+    </div>
+    <ul>
+        <li><a href="gettingstarted.html">Getting Started with Qt</a></li>
+        <li><a href="qt5-intro.html">What's New in Qt 5</a></li>
+        <li><a href="qtexamplesandtutorials.html">Examples and Tutorials</a></li>
+        <li><a href="supported-platforms.html">Supported Platforms</a></li>
+        <li><a href="licensing.html">Qt Licensing</a></li>
+    </ul>
+</div>
+<div class="sectionlist normallist">
+    <div class="heading">
+        <a name="overviews"></a>
+        <h2 id="overviews">Overviews</h2>
+    </div>
+    <ul>
+        <li><a href="topics-app-development.html">Development Tools</a></li>
+        <li><a href="topics-ui.html">User Interfaces</a></li>
+        <li><a href="topics-core.html">Core Internals</a></li>
+        <li><a href="topics-data-storage.html">Data Storage</a></li>
+        <li><a href="qt5-intro.html#multimedia">Multimedia</a></li>
+        <li><a href="topics-network-connectivity.html">Networking and Connectivity</a></li>
+        <li><a href="topics-graphics.html">Graphics</a></li>
+        <li><a href="mobiledevelopment.html">Mobile APIs</a></li>
+        <li><a href="qmlapplications.html">QML Applications</a></li>
+    </ul>
+    <ul>
+        <li><a href="overviews-main.html">All Qt Overviews</a></li>
+    </ul>
+</div>
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index eeb41a3c..ef242889 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -66,7 +66,23 @@
                 The commercially licensed Qt contains additional functionality and
                 productivity tools. For details, see \l{http://www.qt.io/}.
     \enddiv
-    \div {class="col-2"}
+    \div {class="col-2 sidebar"}
+            \div {class="sectionlist normallist"}
+                \div {class="heading"}
+                     \section1 Reference
+                \enddiv
+                \div {class="indexboxcont indexboxbar"}
+                    \list
+                    \li \l{All Classes}{All Qt C++ Classes}
+                    \li \l{All QML Types}
+                    \li \l{All Modules}{All Qt Modules}
+                    \li \l{Qt Creator Manual}
+                    \endlist
+                    \list
+                    \li \l{Qt Reference Pages}{All Qt Reference Documentation}
+                    \endlist
+                \enddiv
+            \enddiv
         \div {class="sectionlist normallist"}
             \div {class="heading"}
                 \section1 Getting Started
@@ -99,22 +115,6 @@
                 \li \l{Qt Overviews}{All Qt Overviews}
                 \endlist
             \enddiv
-            \div {class="sectionlist normallist"}
-                \div {class="heading"}
-                     \section1 Reference
-                \enddiv
-                \div {class="indexboxcont indexboxbar"}
-                    \list
-                    \li \l{All Classes}{All Qt C++ Classes}
-                    \li \l{All QML Types}
-                    \li \l{All Modules}{All Qt Modules}
-                    \li \l{Qt Creator Manual}
-                    \endlist
-                    \list
-                    \li \l{Qt Reference Pages}{All Qt Reference Documentation}
-                    \endlist
-                \enddiv
-            \enddiv
     \enddiv
 \enddiv
 */
-- 
GitLab