Skip to content

Commit 97ef2b2

Browse files
committed
Update docs
1 parent f95c21d commit 97ef2b2

File tree

4 files changed

+179
-161
lines changed

4 files changed

+179
-161
lines changed

README.md

Lines changed: 7 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -36,172 +36,19 @@ For now playground uses some of AnyChart resources, later we'll need to rework i
3636
| ------------- | ------------- |
3737
| Data Sets [source file](https://static.anychart.com/cdn/anydata/common/index.json) | JSON file what contains lists of available data sets.|
3838
| [Tags list](https://static.anychart.com/utility/tags_list.json) | JSON file what contains data for tags generating process. |
39-
| [New Gallery](https://github.com/AnyChart/playground.anychart.com-gallery), [Chartopedia](https://github.com/AnyChart/Chartopedia.git), [API Reference](https://github.com/AnyChart/api.anychart.com.git), [Documentation](https://github.com/AnyChart/docs.anychart.com.git), [Templates](https://github.com/AnyChart/playground-templates.git) | Repositories with predefined samples, some of them are private. |
39+
| [Gallery](https://github.com/AnyChart/ACDVF-playground-samples), [Chartopedia](https://github.com/AnyChart/Chartopedia.git), [API Reference](https://github.com/AnyChart/api.anychart.com.git), [Documentation](https://github.com/AnyChart/docs.anychart.com.git), [Templates](https://github.com/AnyChart/playground-templates.git) | Repositories with predefined samples, some of them are private. |
4040
| [Chartopedia](https://github.com/AnyChart/Chartopedia.git) | Also chartopedia repo is used as a source for Chart Types pages. |
4141

4242

4343
## Usage
44-
Sample config file format:
4544

46-
```
47-
[web]
48-
# Web settings
49-
port = 8080
50-
# used for generation zip - for downloading in editor
51-
zip-folder = "/apps/pg/data/zip/"
52-
53-
54-
[db]
55-
# Dababase settings
56-
port = 5432
57-
name = "playground_db"
58-
user = "playground_user"
59-
password = "playground_password"
60-
61-
62-
[redis]
63-
# redis settings are used for communication between web, generator
64-
# and preview-generator parts
65-
port = 6379
66-
host = "127.0.0.1"
67-
db = 0
68-
queue = "generator-queue-name"
69-
preview-queue = "generator-preview-queue-name"
70-
71-
72-
[notifications.slack]
73-
# Slack notification settings
74-
token = "token"
75-
channel = "#playground_notifications"
76-
username = "playground_bot"
77-
# tag and domain are used in slack messages
78-
domain = "http://playground.example.com/"
79-
tag = "playground"
80-
81-
82-
[previews]
83-
# settings for preview-generator
84-
cdn-purge = true
85-
cdn-prefix = "/pg/"
86-
url-prefix = "http://playground.anychart.local/previews/pg/"
87-
images-dir = "/apps/pg/data/previews"
88-
phantom-engine = "/usr/bin/phantomjs"
89-
generator = "/apps/pg/data/phantom.js"
90-
91-
[previews.maxcdn]
92-
# maxcdn settings, used for purging images when new ones are generated
93-
alias = "anychart"
94-
key = "key"
95-
secret = "secret"
96-
zone-id = 12345
97-
98-
99-
# Repositories settings
100-
[[repositories]]
101-
# Main info
102-
name = "first_repository"
103-
# Folder where the repo will locate
104-
dir = "/playground/data/first_repository"
105-
# Prefix will be used in repository's sample path
106-
url-prefex = "first-repo"
107-
# either generate preview or not
108-
generate-preview = true
109-
# connection type, may be ssh or https
110-
type = "ssh"
111-
112-
# if you choose ssh connection type, describe it
113-
[repositories.ssh]
114-
ssh = "[email protected]:YourCompany/your-repo.git"
115-
secret-key = "/path-to-id_rsa"
116-
public-key = "/path-to-id_rsa.pub"
117-
passphrase = "passphraze"
118-
119-
# or if you choose https
120-
[repositories.https]
121-
https = "https://github.com/YourCompany/your-repo.git"
122-
login = "login"
123-
password = "password"
124-
125-
# Second repository
126-
[[repositories]]
127-
name = "second_repository"
128-
dir = "/playground/data/second_repository"
129-
url-prefex = "second-repo"
130-
generate-preview = true
131-
type = "ssh"
132-
133-
[repositories.ssh]
134-
ssh = "[email protected]:YourCompany/your-repo2.git"
135-
secret-key = "/path-to-id_rsa"
136-
public-key = "/path-to-id_rsa.pub"
137-
passphrase = "passphraze"
138-
```
45+
[Application config](docs/config.md)
13946

140-
[TOML](https://github.com/toml-lang/toml) `.sample` sample format:
141-
```
142-
name = "Chart Name"
143-
description = "Chart description"
144-
short_description = "Short chart description"
145-
146-
[meta]
147-
tags = ["some" "tags"]
148-
export = "chart_name_for_exporting"
149-
show_on_landing = true
150-
151-
[deps]
152-
scripts = ["http://remote-js-dependency.js"]
153-
local-scripts = ["../local-js-dependency.js"]
154-
styles = ["http://remote-css-dependency.css"]
155-
156-
[code]
157-
type = "js"
158-
code = """
159-
// write your sample code here
160-
// anychart.onDocumentReady(function() {
161-
// ...
162-
// });
163-
"""
164-
165-
[style]
166-
type = "css"
167-
code = """
168-
/* write your sample styles here */
169-
"""
170-
171-
[markup]
172-
type = "html"
173-
code = """
174-
<!-- describe your markup here -->
175-
"""
176-
```
177-
178-
HTML `.html` sample format:
179-
```
180-
<html>
181-
<head>
182-
<meta charset="UTF-8"/>
183-
<meta name="ac:name" content="Chart name"/>
184-
<meta name="ac:description" content="Chart description"/>
185-
<meta name="ac:short_description" content="Chart short description"/>
186-
<meta name="ac:tags" content="some, tags"/>
187-
<meta name="ac:show_on_landing" content="true"/>
188-
<script src="../local-js-dependency.js"></script>
189-
<script src="http://remote-js-dependency.js" data-export="true"></script>
190-
<script x-export="chart">
191-
// write your code here
192-
// anychart.onDocumentReady(function () {
193-
// ...
194-
// });
195-
</script>
196-
</head>
197-
<body>
198-
<div id="container" style="width: 100%; height: 100%"></div>
199-
</body>
200-
</html>
201-
```
47+
[Repositories samples format](docs/format.md)
20248

203-
## Database
204-
[Scheme](https://github.com/AnyChart/playground/blob/staging/src/sql/scheme_postgre.sql)
49+
[Editor API](docs/api.md)
20550

51+
[DatabaseScheme](https://github.com/AnyChart/playground/blob/staging/src/sql/scheme_postgre.sql)
20652

207-
AnyChart © 2017
53+
## License
54+
If you have any questions regarding licensing - please contact us. <[email protected]>

doc/api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## API
1+
## Editor API
22
For communication between editor and server the application uses [Transit](https://github.com/cognitect/transit-format) format.
3+
These are some examples of requests. For purpose of easy reading, they are in JSON format.
34
```
45
POST /run
56
Request params:

doc/config.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
## Application config
2+
3+
Application settings are stored in separate file, that uses [TOML](https://github.com/toml-lang/toml) format.
4+
This is sample application config:
5+
6+
```
7+
[web]
8+
# Web settings
9+
port = 8080
10+
# used for generation zip - for downloading in editor
11+
zip-folder = "/apps/pg/data/zip/"
12+
13+
14+
[db]
15+
# Dababase settings
16+
port = 5432
17+
name = "playground_db"
18+
user = "playground_user"
19+
password = "playground_password"
20+
21+
22+
[redis]
23+
# redis settings are used for communication between web, generator
24+
# and preview-generator parts
25+
port = 6379
26+
host = "127.0.0.1"
27+
db = 0
28+
queue = "generator-queue-name"
29+
preview-queue = "generator-preview-queue-name"
30+
31+
32+
[notifications.slack]
33+
# Slack notification settings
34+
token = "token"
35+
channel = "#playground_notifications"
36+
username = "playground_bot"
37+
# tag and domain are used in slack messages
38+
domain = "http://playground.example.com/"
39+
tag = "playground"
40+
41+
42+
[previews]
43+
# settings for preview-generator
44+
cdn-purge = true
45+
cdn-prefix = "/pg/"
46+
url-prefix = "http://playground.anychart.local/previews/pg/"
47+
images-dir = "/apps/pg/data/previews"
48+
phantom-engine = "/usr/bin/phantomjs"
49+
generator = "/apps/pg/data/phantom.js"
50+
51+
[previews.maxcdn]
52+
# maxcdn settings, used for purging images when new ones are generated
53+
alias = "anychart"
54+
key = "key"
55+
secret = "secret"
56+
zone-id = 12345
57+
58+
59+
# Repositories settings
60+
[[repositories]]
61+
# Main info
62+
name = "first_repository"
63+
# Folder where the repo will locate
64+
dir = "/playground/data/first_repository"
65+
# Prefix will be used in repository's sample path
66+
url-prefex = "first-repo"
67+
# either generate preview or not
68+
generate-preview = true
69+
# connection type, may be ssh or https
70+
type = "ssh"
71+
72+
# if you choose ssh connection type, describe it
73+
[repositories.ssh]
74+
ssh = "[email protected]:YourCompany/your-repo.git"
75+
secret-key = "/path-to-id_rsa"
76+
public-key = "/path-to-id_rsa.pub"
77+
passphrase = "passphraze"
78+
79+
# or if you choose https
80+
[repositories.https]
81+
https = "https://github.com/YourCompany/your-repo.git"
82+
login = "login"
83+
password = "password"
84+
85+
# Second repository
86+
[[repositories]]
87+
name = "second_repository"
88+
dir = "/playground/data/second_repository"
89+
url-prefex = "second-repo"
90+
generate-preview = true
91+
type = "ssh"
92+
93+
[repositories.ssh]
94+
ssh = "[email protected]:YourCompany/your-repo2.git"
95+
secret-key = "/path-to-id_rsa"
96+
public-key = "/path-to-id_rsa.pub"
97+
passphrase = "passphraze"
98+
```

doc/format.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
## Repositories samples format
2+
Such projects, like [Gallery](https://github.com/AnyChart/ACDVF-playground-samples),
3+
[Chartopedia](https://github.com/AnyChart/Chartopedia.git),
4+
[API Reference](https://github.com/AnyChart/api.anychart.com.git),
5+
[Documentation](https://github.com/AnyChart/docs.anychart.com.git),
6+
[Templates](https://github.com/AnyChart/playground-templates.git)
7+
use the format describing below for samples:
8+
9+
### TOML
10+
[TOML](https://github.com/toml-lang/toml) `.sample` sample format:
11+
```
12+
name = "Chart Name"
13+
description = "Chart description"
14+
short_description = "Short chart description"
15+
16+
[meta]
17+
tags = ["some" "tags"]
18+
export = "chart_name_for_exporting"
19+
show_on_landing = true
20+
21+
[deps]
22+
scripts = ["http://remote-js-dependency.js"]
23+
local-scripts = ["../local-js-dependency.js"]
24+
styles = ["http://remote-css-dependency.css"]
25+
26+
[code]
27+
type = "js"
28+
code = """
29+
// write your sample code here
30+
// anychart.onDocumentReady(function() {
31+
// ...
32+
// });
33+
"""
34+
35+
[style]
36+
type = "css"
37+
code = """
38+
/* write your sample styles here */
39+
"""
40+
41+
[markup]
42+
type = "html"
43+
code = """
44+
<!-- describe your markup here -->
45+
"""
46+
```
47+
48+
### HTML
49+
HTML `.html` sample format:
50+
```
51+
<html>
52+
<head>
53+
<meta charset="UTF-8"/>
54+
<meta name="ac:name" content="Chart name"/>
55+
<meta name="ac:description" content="Chart description"/>
56+
<meta name="ac:short_description" content="Chart short description"/>
57+
<meta name="ac:tags" content="some, tags"/>
58+
<meta name="ac:show_on_landing" content="true"/>
59+
<script src="../local-js-dependency.js"></script>
60+
<script src="http://remote-js-dependency.js" data-export="true"></script>
61+
<script x-export="chart">
62+
// write your code here
63+
// anychart.onDocumentReady(function () {
64+
// ...
65+
// });
66+
</script>
67+
</head>
68+
<body>
69+
<div id="container" style="width: 100%; height: 100%"></div>
70+
</body>
71+
</html>
72+
```

0 commit comments

Comments
 (0)