Skip to content

Commit b1696e2

Browse files
committed
[docs] Refactor component pages
1 parent 0e6531a commit b1696e2

File tree

5 files changed

+9
-42
lines changed

5 files changed

+9
-42
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "API"
33
draft: false
4-
weight: 3
4+
weight: 4
55
---
66

77
Interact with the API via REST or Python.

docs/docs-site/content/developer/components/_index.md

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ Some of the UI elements in Hue are available as generic [Web Components](https:/
88

99
They can be imported as classic JavaScript modules for your own development needs.
1010

11-
## Component list
12-
13-
* [SQL Parsers](/developer/components/parsers)
14-
* [ER-diagram](/developer/components/er-diagram)
15-
* [SQL Scratchpad](/developer/components/scratchpad)
16-
1711
## Importing
1812

1913
There are two ways to get them:
@@ -56,32 +50,3 @@ In hue_dep `package.json` there is a dependency on Hue:
5650
Now let's import the Hive parser:
5751

5852
import sqlAutocompleteParser from 'hue/desktop/core/src/desktop/js/parse/sql/hive/hiveAutocompleteParser';
59-
60-
61-
## Using
62-
63-
Here is an example on how to use the er-diagram component once installed:
64-
65-
### Import
66-
67-
er-diagram can be imported into an html file using a simple script tag as follows.
68-
69-
<script type = "text/javascript" src="node_modules/gethue/lib/components/ErDiagram.js"></script>
70-
71-
If you are using a bundler like webpack. They can be imported using a normal import statement.
72-
73-
import 'gethue/lib/components/ErDiagram';
74-
75-
### Instantiate
76-
77-
Once imported they can be used like a native HTML tag.
78-
79-
<er-diagram id="erd-id"/>
80-
81-
Please refer these [demo apps](https://github.com/cloudera/hue/tree/master/tools/examples/components) for examples on how the components can be used. You must be able to directly pass attributes, and listen to custom and native events.
82-
83-
### Use as a Vue Component
84-
85-
Internally these components are created using Vue.js & TypeScript. So you can even use them as plain Vue component, and take advantage of Vue features. Vue version of the components are under `gethue/components`.
86-
87-
import ERDiagram from 'gethue/components/er-diagram/index.vue';

docs/docs-site/content/developer/components/parsers/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "SQL Parsers"
33
draft: false
4+
weight: 2
45
---
56

67
## Live Demo

docs/docs-site/content/developer/components/scratchpad/_index.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
---
22
title: "SQL Scratchpad"
33
draft: false
4+
weight: 1
45
---
56

67
The lightweight SQL Editor also called "SQL Scratchpad" comes as its own `<sql-scratchpad />` Web component.
78

89
The SQL Scratchpad component is in **beta** and rapidly evolving. Now is a great time to give it a try and [send feedback](https://github.com/cloudera/hue/issues)!
910

10-
UI:
11+
!["SQL Scratchpad"](https://cdn.gethue.com/uploads/2021/05/sql-scratchpad-v0.5.png)
12+
13+
Adding into a Web page:
1114

1215
We have the `gethue` [dependency](/developer/components/) in `packages.json` or run `npm install gethue`. Then just load it similarly to:
1316

@@ -27,16 +30,14 @@ We have the `gethue` [dependency](/developer/components/) in `packages.json` or
2730

2831
</html>
2932

30-
Note: even simpler you could just skip npm and grab the latest via:
33+
Note: even simpler you could just skip `npm` and grab the latest via:
3134

3235
<script type="text/javascript" src="https://cdn.gethue.com/components/SqlScratchpadWebComponent.js"></script>
3336

3437

35-
Above expects a running Hue or [Compose](https://github.com/gethue/compose) APIs on http://locahost:8005 as the middleware between your Data Warehouse and client.
38+
Above expects a running Hue or [Compose](https://github.com/gethue/compose) APIs on [http://locahost:8005](http://locahost:8005) as the middleware between your Data Warehouse and client.
3639

3740
Note: if using Hue, it currently temporarily requires this ini settings:
3841

3942
[desktop]
4043
cors_enabled=true
41-
42-
!["SQL Scratchpad"](https://cdn.gethue.com/uploads/2021/05/sql-scratchpad-v0.5.png)

docs/docs-site/content/developer/development/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This section goes into greater detail on how to build and reuse the components o
1212

1313
### Dependencies
1414

15-
* The OS specific install instructions are listed in the [install guide](/administrator/installation/dependencies/)
15+
* The OS specific packages are listed in the [install guide](/administrator/installation/dependencies/)
1616
* Python 3.6+ and Django 3 (or Python 2.7 with Django 1.11)
1717
* Vue.js 3
1818
* Node.js ([14.0+](https://deb.nodesource.com/setup_10.x))

0 commit comments

Comments
 (0)