Skip to content

Commit e84bcb6

Browse files
committed
documentation site
1 parent 96ae7bf commit e84bcb6

File tree

117 files changed

+3512
-718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+3512
-718
lines changed

README.md

Lines changed: 45 additions & 717 deletions
Large diffs are not rendered by default.

docs/@wq/$index.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: null
3+
---
4+
{{ site.pages
5+
| where_exp:"p","p.dir == page.dir"
6+
| where_exp:"p","p.name != page.name"
7+
| where_exp:"p","p.name != 'index.md'"
8+
| jsonify }}

docs/@wq/index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
permalink: /@wq/
3+
wq_config:
4+
name: npmpackage
5+
url: "@wq"
6+
order: 31
7+
section: Packages
8+
icon_data: "M12,1.85C11.73,1.85 11.45,1.92 11.22,2.05L3.78,6.35C3.3,6.63 3,7.15 3,7.71V16.29C3,16.85 3.3,17.37 3.78,17.65L5.73,18.77C6.68,19.23 7,19.24 7.44,19.24C8.84,19.24 9.65,18.39 9.65,16.91V8.44C9.65,8.32 9.55,8.22 9.43,8.22H8.5C8.37,8.22 8.27,8.32 8.27,8.44V16.91C8.27,17.57 7.59,18.22 6.5,17.67L4.45,16.5C4.38,16.45 4.34,16.37 4.34,16.29V7.71C4.34,7.62 4.38,7.54 4.45,7.5L11.89,3.21C11.95,3.17 12.05,3.17 12.11,3.21L19.55,7.5C19.62,7.54 19.66,7.62 19.66,7.71V16.29C19.66,16.37 19.62,16.45 19.55,16.5L12.11,20.79C12.05,20.83 11.95,20.83 11.88,20.79L10,19.65C9.92,19.62 9.84,19.61 9.79,19.64C9.26,19.94 9.16,20 8.67,20.15C8.55,20.19 8.36,20.26 8.74,20.47L11.22,21.94C11.46,22.08 11.72,22.15 12,22.15C12.28,22.15 12.54,22.08 12.78,21.94L20.22,17.65C20.7,17.37 21,16.85 21,16.29V7.71C21,7.15 20.7,6.63 20.22,6.35L12.78,2.05C12.55,1.92 12.28,1.85 12,1.85M14,8C11.88,8 10.61,8.89 10.61,10.39C10.61,12 11.87,12.47 13.91,12.67C16.34,12.91 16.53,13.27 16.53,13.75C16.53,14.58 15.86,14.93 14.3,14.93C12.32,14.93 11.9,14.44 11.75,13.46C11.73,13.36 11.64,13.28 11.53,13.28H10.57C10.45,13.28 10.36,13.37 10.36,13.5C10.36,14.74 11.04,16.24 14.3,16.24C16.65,16.24 18,15.31 18,13.69C18,12.08 16.92,11.66 14.63,11.35C12.32,11.05 12.09,10.89 12.09,10.35C12.09,9.9 12.29,9.3 14,9.3C15.5,9.3 16.09,9.63 16.32,10.66C16.34,10.76 16.43,10.83 16.53,10.83H17.5C17.55,10.83 17.61,10.81 17.65,10.76C17.69,10.72 17.72,10.66 17.7,10.6C17.56,8.82 16.38,8 14,8Z"
9+
---
10+
11+
# npm Packages
12+
13+
Django Data Wizard project provides the following packages [on npm][npm]. (Also see the list of [core @wq packages][core]).
14+
15+
[npm]: https://www.npmjs.com/org/wq
16+
[core]: https://wq.io/@wq/

docs/@wq/progress-element.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "@wq/progress-element"
3+
module: Django Data Wizard
4+
---
5+
6+
![@wq/progress-element](../images/@wq/progress-element.svg)
7+
8+
**@wq/progress-element** provides a simple way to create fetch()-powered auto-updating HTML5 [progress] elements. @wq/progress-element is meant to be used with a JSON web service that provides updates as to the current status of a long-running task. @wq/progress-element is primarily intended for (and bundled with) the [Django Data Wizard] package.
9+
10+
## Installation
11+
12+
```bash
13+
npm install @wq/progress-element
14+
```
15+
16+
> Note: @wq/progress-element is designed for Django Data Wizard's Admin-style UI, and is enabled automatically by default. If you are using a wq framework / React UI, use [@wq/wizard] rather than @wq/progress-element.
17+
18+
#### API
19+
20+
@wq/progress-element scans the page for `<progress>` elements during initialization, and can be configured via `data-wq-*` attributes.
21+
22+
- `data-wq-url` configures the URL to use for the AJAX request to update the progress status.
23+
- `data-wq-interval` defines the polling frequency in seconds (default 0.5).
24+
- `data-wq-status` can be used to specify an element which will be used to display `error` or `message` attributes from the JSON response.
25+
26+
```xml
27+
<progress data-wq-url="/getstatus.json"
28+
data-wq-interval=0.25
29+
data-wq-status="status-info"></progress>
30+
<div id="status-info"></div>
31+
```
32+
33+
For older browsers, the `<progress>` bar will automatically fall back to text showing the current status.
34+
35+
@wq/progress-element automatically configures a [@wq/progress] client to start polling the web service. See [@wq/progress] for more details on the expected data structure.
36+
37+
[progress]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress
38+
[Django Data Wizard]: ../index.md
39+
[@wq/wizard]: ./wizard.md
40+
[@wq/progress]: ./progress.md

docs/@wq/progress.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: "@wq/progress"
3+
module: Django Data Wizard
4+
---
5+
6+
![@wq/progress](../images/@wq/progress.svg)
7+
8+
**@wq/progress** provides a simple API client for auto-updating [progress] elements. @wq/progress is meant to be used with a JSON web service that provides updates as to the current status of a long-running task, such as the data import tasks in the [Django Data Wizard] package.
9+
10+
> Note: The jQuery and HTML `<progress>` integration has moved to a separate package, [@wq/progress-element]. wq framework / React UI integration is provided by [@wq/wizard].
11+
12+
## Installation
13+
14+
```bash
15+
npm install @wq/progress
16+
```
17+
18+
#### API
19+
20+
@wq/progress should be configured with a url and polling interval, as well as up to three custom callback functions (`onComplete`, `onFail`, and `onProgress`). The callback functions will be passed the most recent JSON data from the web service.
21+
22+
```javascript
23+
// src/index.js
24+
import { Progress } from '@wq/progress';
25+
26+
const progress = new Progress({
27+
url: 'http://some-web-service/',
28+
interval: 0.5,
29+
onProgress(data) {
30+
console.log(data);
31+
},
32+
});
33+
34+
progress.start();
35+
```
36+
37+
@wq/progress assumes a specific structure for the data from the web service. The following attributes should be specified on the returned JSON object:
38+
39+
- `total`: the total number of items being processed
40+
- `current`: the rank of the currently processing item. (`current / total` will be used to determine the % complete)
41+
- `status`: A text status indicating task state. A status of `"SUCCESS"` or `"FAILURE"` will cause polling to cease and the `onComplete` or `onFailure` callbacks to be called. The status names were originally based on [Celery's state names][celery-states], though Celery is no longer required for [Django Data Wizard].
42+
- `error` or `message`: Will be displayed with the `data-wq-status` option.
43+
44+
[Django Data Wizard]: ../index.md
45+
[@wq/progress-element]: ./progress-element.md
46+
[@wq/wizard]: ./wizard.md
47+
[celery-states]: http://docs.celeryproject.org/en/latest/userguide/tasks.html#states

docs/@wq/wizard.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: "@wq/wizard"
3+
module: Django Data Wizard
4+
---
5+
6+
![@wq/wizard](../images/@wq/wizard.svg)
7+
8+
**@wq/wizard** is a [@wq/app plugin][plugins] providing a complete React UI for the [Django Data Wizard] package.
9+
10+
## Installation
11+
12+
### wq.app for PyPI
13+
14+
When using Django Data Wizard together with [wq.app]'s [wq.js] build, update app/js/{project_name}.js to import and register wizard.js, which is provided by data_wizard's static/app/js directory.
15+
16+
```bash
17+
pip install wq.app data-wizard
18+
```
19+
20+
```javascript
21+
import wq from './wq.js';
22+
import config from './data/config.js';
23+
import wizard from './wizard.js';
24+
25+
wq.use([wizard]);
26+
27+
wq.init(config).then(...);
28+
```
29+
30+
### @wq/app for npm
31+
32+
When using @wq/app for npm, install and import the @wq/wizard npm package.
33+
34+
```bash
35+
npm install @wq/wizard
36+
```
37+
38+
```javascript
39+
import app from '@wq/app';
40+
import material from '@wq/material';
41+
import mapgl from '@wq/map-gl';
42+
import wizard from '@wq/wizard';
43+
import config from './config';
44+
45+
app.use([material, mapgl, wizard]);
46+
47+
app.init(config).then(...);
48+
```
49+
50+
[plugins]: https://wq.io/plugins/
51+
[Django Data Wizard]: ../index.md
52+
[wq.app]: https://wq.io/wq.app/
53+
[wq.js]: https://wq.io/wq
54+
[@wq/app]: https://wq.io/@wq/app

docs/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
django-data-wizard.wq.io

docs/_config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
permalink: "/:title:"
2+
defaults:
3+
-
4+
scope:
5+
path: ""
6+
values:
7+
layout: "default"

docs/_layouts/default.html

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>{{ page.title }}{% if page.title != 'Django Data Wizard' %} - Django Data Wizard{% endif %}</title>
5+
<script type="module" src="/js/$index.js"></script>
6+
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=yes" />
7+
<link rel="icon" type="image/svg+xml" sizes="any" href="/images/icons/django-data-wizard.svg">
8+
<link rel="alternate icon" sizes="16x16 32x32 48x48" href="/favicon.ico">
9+
<style>
10+
img[src$=".svg"] {
11+
display: block;
12+
margin-left: auto;
13+
margin-right: auto;
14+
max-width: 100%;
15+
}
16+
</style>
17+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-9WXC2SBSHH"></script>
18+
<script>
19+
window.dataLayer = window.dataLayer || [];
20+
function gtag(){dataLayer.push(arguments);}
21+
gtag('js', new Date());
22+
gtag('config', 'G-9WXC2SBSHH');
23+
</script>
24+
</head>
25+
<body>
26+
<div id="content" style="display:none">
27+
{% if page.url != '/' %}
28+
<nav>
29+
<a href="/">Home</a>
30+
&gt;
31+
{% if page.dir != page.url %}
32+
<a href="{{ page.dir }}">
33+
{{ site.pages | where_exp:"p","p.url == page.dir" | map: "title" | first }}
34+
</a>
35+
&gt;
36+
{% endif %}
37+
{{ page.title }}
38+
</nav>
39+
{% endif %}
40+
<main>
41+
{{ content }}
42+
{% if page.url == '/' %}
43+
<ul>
44+
{% for p in site.pages %}{% if p.wq_config != nil and p.wq_config.show_in_index != false %}
45+
<li><a href="{{ p.url }}">{{ p.title }}</a></li>{% endif %}{% endfor %}
46+
</ul>
47+
{% elsif page.dir == page.url and page.wq_config.autoindex != false %}
48+
<ul>
49+
{% for p in site.pages %}{% if p.dir == page.dir and p.url != page.dir and p.name != '$index.json' %}
50+
<li><a href="{{ p.url }}">{{ p.title }}</a></li>{% endif %}{% endfor %}
51+
</ul>
52+
{% endif %}
53+
</main>
54+
</div>
55+
<script nomodule>
56+
document.getElementById('content').style.display = 'block';
57+
</script>
58+
</body>
59+
</html>

docs/api/$index.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: null
3+
---
4+
{{ site.pages
5+
| where_exp:"p","p.dir == page.dir"
6+
| where_exp:"p","p.name != page.name"
7+
| where_exp:"p","p.name != 'index.md'"
8+
| jsonify }}

0 commit comments

Comments
 (0)