You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2020/02/26 06:23:23 UTC

[incubator-datasketches-website] 01/01: Cleanup root include and layout files.

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

leerho pushed a commit to branch RootCleanup
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-website.git

commit 318467bfcdcef970e0feff251cde911f69362b0d
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Tue Feb 25 22:22:30 2020 -0800

    Cleanup root include and layout files.
    
    Delete unused files.  Rename the includes for easier understanding.
---
 README.md                                          |  3 +
 _config.yml                                        |  1 -
 _includes/javadocs.html                            | 12 ++++
 _includes/{page_header.html => nav_bar.html}       |  6 +-
 _includes/page_footer.html                         |  2 +-
 _includes/site_head.html                           |  2 +-
 _includes/toc.html                                 | 67 +---------------------
 .../resources/docgen => _includes}/tocScript.html  |  2 +
 _layouts/doc_page.html                             | 37 ++++++------
 _layouts/front_page.html                           | 16 ++++++
 _layouts/html_page.html                            | 14 -----
 _layouts/no_toc_page.html                          | 26 +++++++++
 _layouts/table_page.html                           | 39 -------------
 _layouts/toc_page.html                             | 12 ----
 docs/Frequency/FrequentItemsErrorTable.md          |  7 ++-
 docs/Theta/ThetaErrorTable.md                      |  1 -
 index.md                                           | 14 +----
 overview.md                                        | 27 ---------
 .../apache/datasketches/docgen/TocGenerator.java   | 28 ++++-----
 19 files changed, 99 insertions(+), 217 deletions(-)

diff --git a/README.md b/README.md
index d29d24b..1a4a81a 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,6 @@
+---
+layout: no_toc_page
+---
 <!--
     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
diff --git a/_config.yml b/_config.yml
index c9fe96a..dcdc536 100644
--- a/_config.yml
+++ b/_config.yml
@@ -19,7 +19,6 @@ exclude:
   - DISCLAIMER-WIP
   - LICENSE
   - NOTICE
-  - README.md
   - tmp/
   - target/
   - test-output/
diff --git a/_includes/javadocs.html b/_includes/javadocs.html
new file mode 100644
index 0000000..7e9a8ac
--- /dev/null
+++ b/_includes/javadocs.html
@@ -0,0 +1,12 @@
+<!-- Start _include/javadocs.html -->
+<div class="ds-header">
+  <div class="container">
+    <h4>API Snapshots:
+      <a href="/api/java/snapshot/apidocs/index.html">Java Core</a>,
+      <a href="/api/memory/snapshot/apidocs/index.html">Memory</a>,
+      <a href="/api/pig/snapshot/apidocs/index.html">Pig</a>,
+      <a href="/api/hive/snapshot/apidocs/index.html">Hive</a>,
+    </h4>
+  </div>
+</div>
+<!-- End _include/javadocs.html -->
\ No newline at end of file
diff --git a/_includes/page_header.html b/_includes/nav_bar.html
similarity index 95%
rename from _includes/page_header.html
rename to _includes/nav_bar.html
index ad92d80..834b3f1 100644
--- a/_includes/page_header.html
+++ b/_includes/nav_bar.html
@@ -1,4 +1,4 @@
-<!-- Start _include/page_header.html -->
+<!-- Start _include/nav_bar.html -->
 <div class="navbar navbar-inverse navbar-static-top ds-nav">
   <div class="container">
     <div class="navbar-header">
@@ -14,7 +14,7 @@
     <div class="navbar-collapse collapse">
       <ul class="nav navbar-nav navbar-right">
         <li>
-          <a href="/overview.html">
+          <a href="/docs/TheChallenge.html">
             <span class="fa fa-info-circle"></span> OVERVIEW</a>
         </li>
         <li>
@@ -50,4 +50,4 @@
     </div>
   </div>
 </div>
-<!-- End _include/page_header.html -->
+<!-- End _include/nav_bar.html -->
\ No newline at end of file
diff --git a/_includes/page_footer.html b/_includes/page_footer.html
index 10290eb..978cab3 100644
--- a/_includes/page_footer.html
+++ b/_includes/page_footer.html
@@ -15,4 +15,4 @@
     </div>
   </div>
 </footer>
-<!-- End _include/page_footer.html -->
+<!-- End _include/page_footer.html -->
\ No newline at end of file
diff --git a/_includes/site_head.html b/_includes/site_head.html
index 2e41c9b..220afbb 100644
--- a/_includes/site_head.html
+++ b/_includes/site_head.html
@@ -25,4 +25,4 @@
 </script>
 <script src="https://code.jquery.com/jquery.min.js"></script>
 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
-<!-- End _include/site_head.html -->
+<!-- End _include/site_head.html -->
\ No newline at end of file
diff --git a/_includes/toc.html b/_includes/toc.html
index 067339f..c916bcc 100644
--- a/_includes/toc.html
+++ b/_includes/toc.html
@@ -1,3 +1,4 @@
+<!-- Start _includes/toc.html -->
 <!-- Computer Generated File, Do Not Edit! -->
 <link rel="stylesheet" href="/css/toc.css">
 <div id="toc" class="nav toc hidden-print">
@@ -275,68 +276,4 @@
     <li><a href="{{site.docs_dir}}/Community/Research.html">Research</a></li>
   </div>
 </div>
-<script>
-  (function () {
-
-    var findLineItem = function (path) {
-      return document.querySelector(`[href="${path}"]`);
-    };
-
-    var highlighLineItem = function (element) {
-      element.classList.add('highlight');
-    };
-
-    var checkHasClass = function (element, className) {
-      return element.className.split(' ').find(function (item) { return item === className || '' })
-    }
-
-    var findAllCollapseParents = function (element) {
-      var collapseMenus = [];
-      var elementPointer = element;
-      while (elementPointer !== document.body) {
-        if (checkHasClass(elementPointer, 'collapse')) {
-          collapseMenus.push(elementPointer);
-        }
-        elementPointer = elementPointer.parentElement
-      }
-      return collapseMenus
-    };
-
-    var findMatchingCollapseMenu = function (collapseItem) {
-      return document.querySelector(`[href="#${collapseItem.id}"]`);
-    };
-
-    var findAllParentMenus = function (element) {
-      var parentMenus = []
-      var elementPointer = element;
-      while (elementPointer !== document.body) {
-        if (elementPointer.className.split(' ').indexOf('menu') > -1) {
-          parentMenus.push(elementPointer);
-        }
-        elementPointer = elementPointer.parentElement;
-      }
-      return parentMenus;
-    }
-
-    var openMenuItem = function (element) {
-      element.click();
-    };
-
-    var openAllFromList = function (elementList) {
-      elementList.forEach(function (element) {
-        console.log(element)
-        openMenuItem(findMatchingCollapseMenu(element))
-      });
-    };
-
-    var highlightAndOpenMenu = function () {
-      var currentLineItem = findLineItem(document.location.pathname);
-      highlighLineItem(currentLineItem)
-      openAllFromList(findAllCollapseParents(currentLineItem));
-    };
-
-    $(highlightAndOpenMenu);
-
-  }());
-</script>
-
+<!-- End _includes/toc.html -->
\ No newline at end of file
diff --git a/src/main/resources/docgen/tocScript.html b/_includes/tocScript.html
similarity index 95%
rename from src/main/resources/docgen/tocScript.html
rename to _includes/tocScript.html
index 8a5ec35..d89bf96 100644
--- a/src/main/resources/docgen/tocScript.html
+++ b/_includes/tocScript.html
@@ -1,3 +1,4 @@
+<!-- Start _includes/tocScript.html -->
 <script>
   (function () {
 
@@ -62,3 +63,4 @@
 
   }());
 </script>
+<!-- End _includes/tocScript.html -->
\ No newline at end of file
diff --git a/_layouts/doc_page.html b/_layouts/doc_page.html
index 43e2fe2..f10e032 100644
--- a/_layouts/doc_page.html
+++ b/_layouts/doc_page.html
@@ -3,39 +3,36 @@
 <html lang="en">
 
 <head>
-  {% include site_head.html %}
+{% include site_head.html %}
 </head>
 
 <body>
-  {% include page_header.html %}
-
-  <div class="ds-header">
-    <div class="container">
-      <h4>API Snapshots:
-        <a href="/api/java/snapshot/apidocs/index.html">Java Core</a>,
-        <a href="/api/memory/snapshot/apidocs/index.html">Memory</a>,
-        <a href="/api/pig/snapshot/apidocs/index.html">Pig</a>,
-        <a href="/api/hive/snapshot/apidocs/index.html">Hive</a>,
-      </h4>
-    </div>
-  </div>
+{% include nav_bar.html %}
+
+{% include javadocs.html %}
 
   <div class="container">
     <div class="row">
+      <!-- Start ToC Block -->
       <div class="col-md-3">
         <div class="searchbox" style="position:relative">
           <gcse:searchbox-only></gcse:searchbox-only>
         </div>
-        {% include toc.html %}
+
+{% include toc.html %}
       </div>
+      <!-- End ToC Block -->
+
+{% include tocScript.html %}
+
       <div class="col-md-9 doc-content">
-        {{ content }}
-      </div>
-    </div>
-  </div>
+{{ content }}
+      </div> <!-- End content -->
+    </div> <!-- End row -->
+  </div> <!-- End Container -->
 
-  {% include page_footer.html %}
+{% include page_footer.html %}
 </body>
 
 </html>
-<!-- End _layouts/doc_page.html-->
+<!-- End _layouts/doc_page.html-->
\ No newline at end of file
diff --git a/_layouts/front_page.html b/_layouts/front_page.html
new file mode 100644
index 0000000..aee23a2
--- /dev/null
+++ b/_layouts/front_page.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<!-- Start _layouts/html_page.html-->
+<html lang="en">
+
+<head>
+{% include site_head.html %}
+</head>
+
+<body>
+{% include nav_bar.html %} 
+{{ content }}
+{% include page_footer.html %}
+</body>
+
+</html>
+<!-- End _layouts/html_page.html-->
\ No newline at end of file
diff --git a/_layouts/html_page.html b/_layouts/html_page.html
deleted file mode 100644
index 02878b6..0000000
--- a/_layouts/html_page.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<!-- Start _layouts/html_page.html-->
-<html lang="en">
-
-<head>
-    {% include site_head.html %}
-</head>
-
-<body>
-    {% include page_header.html %} {{ content }} {% include page_footer.html %}
-</body>
-
-</html>
-<!-- End _layouts/html_page.html-->
diff --git a/_layouts/no_toc_page.html b/_layouts/no_toc_page.html
new file mode 100644
index 0000000..e4b582d
--- /dev/null
+++ b/_layouts/no_toc_page.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<!-- Start _layouts/no_toc_page.html-->
+<html lang="en">
+
+<head>
+{% include site_head.html %}
+</head>
+
+<body>
+{% include nav_bar.html %}
+
+{% include javadocs.html %}
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-9 doc-content">
+{{ content }}
+    </div>
+  </div>
+</div>
+
+{% include page_footer.html %}
+</body>
+
+</html>
+<!-- End _layouts/no_toc_page.html-->
\ No newline at end of file
diff --git a/_layouts/table_page.html b/_layouts/table_page.html
deleted file mode 100644
index b50f233..0000000
--- a/_layouts/table_page.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html>
-<!-- Start _layouts/table_page.html-->
-<html lang="en">
-
-<head>
-  {% include site_head.html %}
-</head>
-
-<body>
-  {% include page_header.html %}
-
-  <div class="ds-header">
-    <div class="container">
-      <h1>{{ page.title }}</h1>
-      <h3>{{ page.subtitle }}</h3>
-      <h4>API Snapshots:
-        <a href="/api/java/snapshot/apidocs/index.html">Java Core</a>,
-        <a href="/api/memory/snapshot/apidocs/index.html">Memory</a>,
-        <a href="/api/pig/snapshot/apidocs/index.html">Pig</a>,
-        <a href="/api/hive/snapshot/apidocs/index.html">Hive</a>,
-      </h4>
-    </div>
-  </div>
-
-  <div class="container">
-    <div class="row">
-      <div class="col-md-9 doc-content">
-          {{ content }}
-      </div>>
-    </div>
-  </div>
-
-  {% include page_footer.html %}
-
-  <script>$(function () { $(".toc").load("/docs/toc.html"); });</script>
-</body>
-
-</html>
-<!-- End _layouts/table_page.html-->
diff --git a/_layouts/toc_page.html b/_layouts/toc_page.html
deleted file mode 100644
index 787d8ed..0000000
--- a/_layouts/toc_page.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html>
-<!-- Start _layouts/toc_page.html-->
-<html lang="en">
-
-<body>
-
-    {{ content }}
-
-</body>
-
-</html>
-<!-- End _layouts/toc_page.html-->
diff --git a/docs/Frequency/FrequentItemsErrorTable.md b/docs/Frequency/FrequentItemsErrorTable.md
index 32a20f5..ddfcb3f 100644
--- a/docs/Frequency/FrequentItemsErrorTable.md
+++ b/docs/Frequency/FrequentItemsErrorTable.md
@@ -1,7 +1,5 @@
 ---
-layout: table_page
-title: Frequent Items
-subtitle: Error Threshold Table
+layout: no_toc_page
 ---
 <!--
     Licensed to the Apache Software Foundation (ASF) under one
@@ -21,6 +19,9 @@ subtitle: Error Threshold Table
     specific language governing permissions and limitations
     under the License.
 -->
+# Frequent Items
+### Error Threshold Table
+
 This table of thresholds is computed a follows:
 
 *  <i>M</i> = Max Map Size.  Always a power of 2.
diff --git a/docs/Theta/ThetaErrorTable.md b/docs/Theta/ThetaErrorTable.md
index 237c670..2b624f8 100644
--- a/docs/Theta/ThetaErrorTable.md
+++ b/docs/Theta/ThetaErrorTable.md
@@ -1,5 +1,4 @@
 ---
-sectionid: docs
 layout: doc_page
 ---
 <!--
diff --git a/index.md b/index.md
index c1c6b37..f7c5313 100644
--- a/index.md
+++ b/index.md
@@ -1,8 +1,5 @@
 ---
-published: true
-title: DataSketches
-layout: html_page
-id: home
+layout: front_page
 ---
 <!-- Start /index.md -->
 <!--
@@ -37,15 +34,6 @@ id: home
         <a href="https://en.wikipedia.org/wiki/Stochastic" style="color: #EDE379"><i>stochastic</i></a> 
         <a href="https://en.wikipedia.org/wiki/Streaming_algorithm" style="color: #EDE379"><i>streaming algorithms</i></a></p>
       <!--<p class="lead" style="font-size: 16px; line-height: 1.0; margin-bottom: 15px"><i>"Excellence in theoretically informed algorithm engineering" -- Graham Cormode</i></p> -->
-      <!--
-      <p>
-        <a class="btn btn-lg btn-outline-inverse" href="overview.html"><span class="fa fa-info-circle"></span> Overview</a>
-        <a class="btn btn-lg btn-outline-inverse" href="/docs/Community/Downloads.html"><span class="fa fa-download"></span> Download</a>
-        <a class="btn btn-lg btn-outline-inverse" href="https://github.com/apache?utf8=%E2%9C%93&q=datasketches"><span class="fa fa-github"></span> GitHub</a>
-        <a class="btn btn-lg btn-outline-inverse" href="/docs/Community/Research.html"><span class="fa fa-paper-plane"></span> Research</a>
-        <a class="btn btn-lg btn-outline-inverse" href="/docs/Community/index.html" style="padding-top: 5px; padding-bottom: 0px; padding-left: 11.64px; padding-right: 12px;"><img class="ds-small-man" src="/img/datasketches-ManWhite.svg"/>Community</a>
-      </p>
-      -->
     </div>
   </div>
   </div>
diff --git a/overview.md b/overview.md
deleted file mode 100644
index fe7dd65..0000000
--- a/overview.md
+++ /dev/null
@@ -1,27 +0,0 @@
----
-layout: html_page
----
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<script type="text/javascript">
-<!--
-window.location = "/docs/TheChallenge.html"
-//-->
-</script>
-
diff --git a/src/main/java/org/apache/datasketches/docgen/TocGenerator.java b/src/main/java/org/apache/datasketches/docgen/TocGenerator.java
index 78cd4f5..d3edb57 100644
--- a/src/main/java/org/apache/datasketches/docgen/TocGenerator.java
+++ b/src/main/java/org/apache/datasketches/docgen/TocGenerator.java
@@ -37,8 +37,7 @@ public class TocGenerator {
   private static final String LS = System.getProperty("line.separator");
   private int level = 0;
   private PrintWriter pw = null;
-  private String jsonScrFile;
-  private String htmlScriptFile;
+  private String jsonSrcFile;
 
   TocGenerator() {} //needed for TestNG
 
@@ -47,6 +46,7 @@ public class TocGenerator {
    * <ol>
    *  <li>Edit the JSON source file (referenced below) for the structure you want.
    *  Be careful not to use any HTML reserved symbols! </li>
+   *  <li>Note that the javascript required is located in the _includes directory.
    *  <li>Execute this test.  The result will be placed in the proper location as part of the web
    *  source.</li>
    *  <li>Stage the changes and push the web site source to origin.</li>
@@ -57,9 +57,8 @@ public class TocGenerator {
     @Test
     public static void runTocGenerator() {
       final String jsonSrcFile = "src/main/resources/docgen/toc.json";
-      final String htmlScriptFile = "src/main/resources/docgen/tocScript.html";
       final String tgtTocFile = "_includes/toc.html";
-      TocGenerator tocgen = new TocGenerator(jsonSrcFile, htmlScriptFile, tgtTocFile);
+      TocGenerator tocgen = new TocGenerator(jsonSrcFile, tgtTocFile);
       tocgen.readJson();
     }
 
@@ -69,9 +68,8 @@ public class TocGenerator {
    * @param htmlScriptFile The javascript source file
    * @param tgtTocFile the target toc.html file
    */
-  public TocGenerator(final String jsonSrcFile, final String htmlScriptFile, final String tgtTocFile) {
-    jsonScrFile = jsonSrcFile;
-    this.htmlScriptFile = htmlScriptFile;
+  public TocGenerator(final String jsonSrcFile, final String tgtTocFile) {
+    this.jsonSrcFile = jsonSrcFile;
     if (tgtTocFile != null && !tgtTocFile.isEmpty()) {
       final File file = new File(tgtTocFile);
       if (file.exists()) { file.delete(); }
@@ -84,16 +82,12 @@ public class TocGenerator {
    */
   public void readJson() {
     final StringBuilder sb = new StringBuilder();
-    final String jin = Files.fileToString(jsonScrFile);
+    final String jin = Files.fileToString(jsonSrcFile);
     final JSONObject jo = new JSONObject(jin);
     final String clazz = jo.getString("class");
     if (clazz.equals("TOC")) { emitToc(jo, sb); }
     else if (clazz.equals("Dropdown")) { emitDropdown(jo, sb); }
     else { emitDoc(jo, sb); }
-    if (htmlScriptFile != null && !htmlScriptFile.isEmpty()) {
-      final String script = Files.fileToString(htmlScriptFile);
-      sb.append(script);
-    }
     println(sb.toString());
   }
 
@@ -103,6 +97,7 @@ public class TocGenerator {
    * @param sb the target StringBuilder
    */
   void emitToc(final JSONObject toc, final StringBuilder sb) {
+    sb.append("<!-- Start _includes/toc.html -->").append(LS);
     sb.append("<!-- Computer Generated File, Do Not Edit! -->").append(LS);
     sb.append("<link rel=\"stylesheet\" href=\"/css/toc.css\">").append(LS);
     sb.append("<div id=\"toc\" class=\"nav toc hidden-print\">").append(LS);
@@ -120,6 +115,7 @@ public class TocGenerator {
     level--;
 
     sb.append("</div>").append(LS);
+    sb.append("<!-- End _includes/toc.html -->").append(LS);
   }
 
   /**
@@ -247,17 +243,15 @@ public class TocGenerator {
 
   /**
    * Command line access.
-   * @param args three arguments are required:
+   * @param args two arguments are required:
    * <ol><li>The JSON source file</li>
-   * <li>The html script file that is appended to the end.</li>
    * <li>The target toc.html file</li>
    * </ol>
    */
   public static void main(final String[] args) {
     final String jsonSrcFile = args[0];
-    final String htmlScriptFile = args[1];
-    final String tgtTocFile = args[2];
-    final TocGenerator tocgen = new TocGenerator(jsonSrcFile, htmlScriptFile, tgtTocFile);
+    final String tgtTocFile = args[1];
+    final TocGenerator tocgen = new TocGenerator(jsonSrcFile, tgtTocFile);
     tocgen.readJson();
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org