Browse Source

HUE-8818 [editor] Style tables and notes in the Hive language reference

Johan Ahlen 6 years ago
parent
commit
70da642bd6
43 changed files with 54 additions and 2 deletions
  1. 0 0
      desktop/core/src/desktop/static/desktop/css/hue-embedded.css
  2. 0 0
      desktop/core/src/desktop/static/desktop/css/hue.css
  3. 0 0
      desktop/core/src/desktop/static/desktop/css/hue3-extra.css
  4. 1 1
      desktop/core/src/desktop/static/desktop/docs/hive/_103092177.json
  5. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362030.json
  6. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362032.json
  7. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362033.json
  8. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362034.json
  9. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362035.json
  10. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362036.json
  11. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362037.json
  12. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362039.json
  13. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362040.json
  14. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362042.json
  15. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362043.json
  16. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362044.json
  17. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362048.json
  18. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362049.json
  19. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27829682.json
  20. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27837968.json
  21. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27838462.json
  22. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27842758.json
  23. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_30151323.json
  24. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_30754722.json
  25. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_30755801.json
  26. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_31818911.json
  27. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_31819589.json
  28. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_31822176.json
  29. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_33293167.json
  30. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_33298193.json
  31. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_34838882.json
  32. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_38570914.json
  33. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_38572242.json
  34. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_40509928.json
  35. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_45876173.json
  36. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_45876440.json
  37. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_47384180.json
  38. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_58851803.json
  39. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_59690156.json
  40. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_95654003.json
  41. 35 0
      desktop/core/src/desktop/static/desktop/less/hue-assist.less
  42. 2 0
      desktop/core/src/desktop/templates/assist.mako
  43. 16 1
      tools/sql-docs/hiveExtractor.js

File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue-embedded.css


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue.css


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue3-extra.css


+ 1 - 1
desktop/core/src/desktop/static/desktop/docs/hive/_103092177.json

@@ -1 +1 @@
-{"body":"<div><div>\n        <div id=\"title\">\n                        <h1>Partition Filter Syntax</h1>\n        </div>\n\n        <!--<div id=\"toc\" class=\"content prepend-top\">\n            <h1>Table of Contents</h1>\n            $replacement.render(\"toc\")\n        </div>-->\n\n        <div id=\"src-103092177\">\n            <p>\n    Example: for a table having partition keys <tt>country</tt> and <tt>state</tt>, one could construct the following filter:            </p>\n                <p style=\"margin-left:30px;\">\n    <tt>country = \"USA\" AND (state = \"CA\" OR state = \"AZ\")</tt>            </p>\n                <p>\n    In particular notice that it is possible to nest sub-expressions within parentheses.            </p>\n                <p>\n    The following operators are supported when constructing filters for partition columns (derived from <a class=\"hue-doc-external-link\" href=\"https://jira.apache.org/jira/browse/HIVE-1862\" target=\"_blank\">HIVE-1862</a>):            </p>\n    <ul><li>            <p>\n    <tt>=</tt>            </p>\n    </li><li>            <p>\n    <tt>&lt;</tt>            </p>\n    </li><li>            <p>\n    <tt>&lt;=</tt>            </p>\n    </li><li>            <p>\n    <tt>&gt;</tt>            </p>\n    </li><li>            <p>\n    <tt>&gt;=</tt>            </p>\n    </li><li>            <p>\n    <tt>&lt;&gt;</tt>            </p>\n    </li><li>            <p>\n    <tt>AND</tt>            </p>\n    </li><li>            <p>\n    <tt>OR</tt>            </p>\n    </li><li>            <p>\n    <tt>LIKE</tt> (on keys of type <tt>string</tt> only, supports literal string template with '.<tt>*'</tt> wildcard)<tt></tt>            </p>\n    </li></ul>        </div>\n    </div></div>","title":"Partition Filter Syntax"}
+{"body":"<div><div>\n        <div id=\"title\">\n                        <h1 class=\"hue-doc-title-hive\">Partition Filter Syntax</h1>\n        </div>\n\n        <!--<div id=\"toc\" class=\"content prepend-top\">\n            <h1>Table of Contents</h1>\n            $replacement.render(\"toc\")\n        </div>-->\n\n        <div id=\"src-103092177\">\n            <p>\n    Example: for a table having partition keys <tt>country</tt> and <tt>state</tt>, one could construct the following filter:            </p>\n                <p style=\"margin-left:30px;\">\n    <tt>country = \"USA\" AND (state = \"CA\" OR state = \"AZ\")</tt>            </p>\n                <p>\n    In particular notice that it is possible to nest sub-expressions within parentheses.            </p>\n                <p>\n    The following operators are supported when constructing filters for partition columns (derived from <a class=\"hue-doc-external-link\" href=\"https://jira.apache.org/jira/browse/HIVE-1862\" target=\"_blank\">HIVE-1862</a>):            </p>\n    <ul><li>            <p>\n    <tt>=</tt>            </p>\n    </li><li>            <p>\n    <tt>&lt;</tt>            </p>\n    </li><li>            <p>\n    <tt>&lt;=</tt>            </p>\n    </li><li>            <p>\n    <tt>&gt;</tt>            </p>\n    </li><li>            <p>\n    <tt>&gt;=</tt>            </p>\n    </li><li>            <p>\n    <tt>&lt;&gt;</tt>            </p>\n    </li><li>            <p>\n    <tt>AND</tt>            </p>\n    </li><li>            <p>\n    <tt>OR</tt>            </p>\n    </li><li>            <p>\n    <tt>LIKE</tt> (on keys of type <tt>string</tt> only, supports literal string template with '.<tt>*'</tt> wildcard)<tt></tt>            </p>\n    </li></ul>        </div>\n    </div></div>","title":"Partition Filter Syntax"}

File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362030.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362032.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362033.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362034.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362035.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362036.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362037.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362039.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362040.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362042.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362043.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362044.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362048.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362049.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27829682.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27837968.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27838462.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27842758.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_30151323.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_30754722.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_30755801.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_31818911.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_31819589.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_31822176.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_33293167.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_33298193.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_34838882.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_38570914.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_38572242.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_40509928.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_45876173.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_45876440.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_47384180.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_58851803.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_59690156.json


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_95654003.json


+ 35 - 0
desktop/core/src/desktop/static/desktop/less/hue-assist.less

@@ -656,6 +656,29 @@
     margin: 8px 0;
   }
 
+  .hue-doc-table-hive {
+    margin: 10px 0 0 0;
+    overflow-x: auto;
+    border-collapse: collapse;
+  }
+
+  .hue-doc-table-hive thead .hue-doc-td-hive {
+    background-color: #f4f5f7;
+  }
+
+  .hue-doc-td-hive,
+  .hue-doc-th-hive {
+    min-width: 8px;
+    border: 1px solid #c1c7d0;
+    padding: 7px 10px;
+    vertical-align: top;
+    text-align: left;
+  }
+
+  .hue-doc-title-hive {
+    color: @hue-primary-color-dark;
+  }
+
   .hue-doc-title {
     color: @hue-primary-color-dark;
     font: 15px/normal @font-family-monospace;
@@ -701,6 +724,18 @@
     }
   }
 
+  .hue-doc-note-hive {
+    border: 1px solid @hue-primary-color-light;
+    border-radius: 4px;
+    padding: 0 10px;
+    margin: 10px 0 10px 0;
+
+    div {
+      margin-top: 10px;
+      font-weight: bold;
+    }
+  }
+
   .hue-doc-varname {
     font-family: @font-family-monospace;
     font-style: italic;

+ 2 - 0
desktop/core/src/desktop/templates/assist.mako

@@ -3679,6 +3679,8 @@ from desktop.views import _ko
 
         var updateContentsForType = function (type, isSqlDialect) {
           self.sourceType(type);
+
+          // TODO: Get these dynamically from langref and functions modules when moved to webpack
           self.functionsTabAvailable(type === 'hive' || type === 'impala' || type === 'pig');
           self.langRefTabAvailable(type === 'hive' || type === 'impala');
           self.editorAssistantTabAvailable((!window.IS_EMBEDDED || window.EMBEDDED_ASSISTANT_ENABLED) && isSqlDialect);

+ 16 - 1
tools/sql-docs/hiveExtractor.js

@@ -87,7 +87,16 @@ const adaptElement = element => {
     const replacement = fragments.join('');
     element.replace(libxml.parseHtmlFragment(replacement).root());
   } else if (element.attr('class')) {
-    element.attr('class').remove();
+    if (
+      element
+        .attr('class')
+        .value()
+        .indexOf('admonition') !== -1
+    ) {
+      element.attr({ class: 'hue-doc-note-hive' });
+    } else {
+      element.attr('class').remove();
+    }
   }
 
   switch (element.name()) {
@@ -126,7 +135,13 @@ const adaptElement = element => {
       break;
     case 'h1':
       element.text(element.text().replace(/LanguageManual\s(.+)/, '$1'));
+      element.attr({ class: 'hue-doc-title-hive' });
       break;
+    case 'table':
+    case 'td':
+    case 'th':
+    case 'tr':
+      element.attr({ class: 'hue-doc-' + element.name() + '-hive' });
     default:
   }
 

Some files were not shown because too many files changed in this diff