This is an automated email from the ASF dual-hosted git repository.

niketanpansare pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/systemml.git


The following commit(s) were added to refs/heads/master by this push:
     new ea82102  [SYSTEMML-2520] Add documentation search with Algolia service
ea82102 is described below

commit ea821028bfc5869d5874163885ec73bf4d14670a
Author: Janardhan <janardhan.pulivar...@gmail.com>
AuthorDate: Tue Mar 19 13:08:10 2019 -0700

    [SYSTEMML-2520] Add documentation search with Algolia service
    
    Algolia is an api based service, indexes the documentation every 24h.
    - When we query a keyword, the results would be rendered in a dropdown form.
    
    Also, navigation header fix for the dropdown in iphone, and on minimize 
screen on
    normal screens.
    
    Closes #855.
---
 docs/_layouts/global.html | 31 ++++++++++++++++++++++++++++++-
 docs/css/main.css         | 30 +++++++++++++++++++++++++++---
 2 files changed, 57 insertions(+), 4 deletions(-)

diff --git a/docs/_layouts/global.html b/docs/_layouts/global.html
index 4286c9c..734b2a0 100644
--- a/docs/_layouts/global.html
+++ b/docs/_layouts/global.html
@@ -15,10 +15,13 @@
         <link rel="stylesheet" href="css/main.css">
         <link rel="stylesheet" href="css/pygments-default.css">
         <link rel="shortcut icon" href="img/favicon.png">
+        <link rel="stylesheet" 
href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css"; 
/> 
     </head>
     <body>
         <!--[if lt IE 7]>
-            <p class="chromeframe">You are using an outdated browser. <a 
href="http://browsehappy.com/";>Upgrade your browser today</a> or <a 
href="http://www.google.com/chromeframe/?redirect=true";>install Google Chrome 
Frame</a> to better experience this site.</p>
+            <p class="chromeframe">The present browser may not be up-to-date. 
<a href="http://browsehappy.com/";>
+                Please consider upgrading to the latest version</a> or <a 
href="http://www.google.com/chromeframe/?redirect=true";>
+                    install Google Chrome Frame</a> better browsing 
experience.</p>
         <![endif]-->
 
         <header class="navbar navbar-default navbar-fixed-top" id="topbar">
@@ -93,6 +96,16 @@
                                 {% endif %}
                             </ul>
                         </li>
+                        <!-- How Algolia search works? 
+                        * 1. This service runs the crawler on the docs every 
24 hrs and creates index.
+                        * 2. When the user inputs a keyword into this input 
with `id="s-bar"`, 
+                             a. the keyword will be found out, with the 
javascript functions resting in cdn. 
+                             b. and related items populate on a nicely 
formatted dropdown whose styling lies in the cdn.
+                        * 3. When the user clicks on an intersted item in the 
dropdown link, one will end up at the anchor
+                             link of the item.
+
+                        -->
+                        <li><input id="s-bar" placeholder="Search 
Docs.."style="margin-top: 20px;"></input></li>
                     </ul>
                 </nav>
             </div>
@@ -254,5 +267,21 @@
                 d.getElementsByTagName('head')[0].appendChild(script);
             }(document));
         </script>
+        <!-- Algolia search section -->
+        <script type="text/javascript" 
src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js";></script>
+        <script>
+            // Crawler configuration for the search indexing is available at:
+            // 
https://github.com/algolia/docsearch-configs/blob/master/configs/apache_systemml.json
+
+            docsearch({ 
+                apiKey: '78c19564c220d4642a41197baae304ef', 
+                indexName: 'apache_systemml', 
+                inputSelector: "#s-bar", 
+                // For custom styling for the dropdown, please set debug to 
true
+                // so that the dropdown won't disappear when the inspect tools 
are 
+                // open.
+                debug: false 
+            });
+        </script>        
     </body>
 </html>
diff --git a/docs/css/main.css b/docs/css/main.css
index 8a7426b..3dd758b 100644
--- a/docs/css/main.css
+++ b/docs/css/main.css
@@ -61,6 +61,7 @@ h1, h2, h3, h4, h5, h6 {
 pre {
   background-color: #FFF
 }
+
 /* Branding */
 .brand {
   font-weight: normal !important;
@@ -81,7 +82,7 @@ img.logo {
 /* Navigation Bar */
 .navbar {
   background-color: rgba(0, 0, 0, 0.9);
-  height: 68px;
+  /*height: 68px;*/
 }
 
 .navbar-brand {
@@ -96,12 +97,28 @@ img.logo {
   height: 100%;
 }
 
+.navbar-collapse {
+  /*height: 67px !important;*/
+  background: rgba(0,0,0,0);
+}
+
 .navbar-collapse.collapse {
-  height: 67px !important;
+  background: rgba(0, 0, 0, 0);
+  border-top: 0px;
+}
+
+.navbar-collapse.collapsing {
+  background: rgba(0, 0, 0, 0);
+  border-top: 0px;
+}
+
+.navbar-toggle {
+ border-radius: 1px;
 }
 
 .navbar-header {
-  padding-top: 10px;
+  padding-top: 0px;
+  padding-bottom: 10px;
 }
 
 .navbar .container {
@@ -159,6 +176,13 @@ img.logo {
 }
 
 /**
+ * Search bar
+ */
+input#s-bar {
+  margin-left: 10px;
+}
+
+/**
  * MathJax (embedded latex formulas)
  */
 .MathJax .mo { color: inherit }

Reply via email to