-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathphd.config.js
214 lines (214 loc) · 11.1 KB
/
phd.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
const mixin = {
js: [ 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/highlight.min.js', ],
css: [
'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/styles/railscasts.min.css',
'https://fonts.googleapis.com/css?family=Raleway:300,400,500,600,700',
'https://fonts.googleapis.com/css?family=Merriweather:900',
'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css',
"src/style.css"
],
init: function() {
hljs.configure({ languages: ["javascript"] });
hljs.initHighlighting();
}
};
module.exports = [{
input: {
$components: [
{ $type: "h1", class: "center", $text: "ST" },
{
class: "center", $components: [
{ $text: "Select Transform" },
{ $type: "br" },
{ $text: "JSON Template over JSON", class: 'em' },
{ $type: "a", href: "https://github.com/SelectTransform/st.js", class: "btn btn-primary", $text: "Github" },
{ $type: "a", href: "https://selecttransform.github.io/playground/", class: "btn btn-primary", $text: "Try" },
{ $type: "a", href: "https://twitter.com/selecttransform", class: "btn btn-primary", $text: "Twitter" }
]
},
{ $type: "hr" },
{ $type: "img", src: "src/st.gif" },
{
class: 'container',
$components: [
{ $type: "hr" },
{ $type: "h1", $text: "Features" },
{
class: "row", $components: [
{ class: "col", $inherit: "md", $file: "src/markdown/index/features_select.md" },
{ class: "col", $inherit: "md", $file: "src/markdown/index/features_transform.md" },
]
},
{ $type: "hr" },
{ $type: "h1", $text: "How Does It Work?" },
{ $type: "ol", $components: [
{ $type: "li", $html: "<code>st.js</code> is a library that adds a couple of powerful methods to JavaScript's native JSON." },
{ $type: "li", $html: "So you can simply use it with the syntax <code>ST.select(...).transform(...)</code>" },
{ $type: "li", $html: "The library is just a <a href='https://github.com/SelectTransform/st.js/blob/develop/st.js'>single file</a>, made up of <code>stateless functions</code>, with <code>NO dependency</code>." },
{ $type: "li", $html: "Which makes it effortless to <code>embed anywhere</code> without hassle. (Currently used in various environments including iOS, Android, node.js, browser, etc.)" },
]},
{ $type: "hr" },
{ $type: "h1", $text: "What Can I Use It For?" },
{ $text: "JSON powers almost everything in the world." },
{ $text: "Being able to bend any JSON to your will means you can do all kinds of magical things" },
{ $type: "hr" },
{ $type: "h2", $text: "1. Declarative JSON API Template" },
{ $text: "Build JSON using a simple, human-readable, and declarative template instead of manually coding it." },
{ $type: "a", href: "https://github.com/SelectTransform/api.template", class: "btn btn-primary rectangle", $text: "Visit Github" },
{ $type: "br" },
{
class: "row", $components: [
{ class: "col", $inherit: "md", $file: "src/markdown/index/api_before.md" },
{ class: "col", $inherit: "md", $file: "src/markdown/index/api_after.md" },
]
},
{ $type: "hr" },
{ $type: "h2", $text: "2. Parse JSON like never before" },
{ $html: "Parse JSON anywhere, both frontend and backend, as easy as using <code>JSON.stringify</code> or <code>JSON.parse</code>" },
{ $type: "a", href: "https://github.com/SelectTransform/playground", class: "btn btn-primary rectangle", $text: "Visit Github" },
{ $type: "br" },
{
class: "row", $components: [
{ $type: "img", class: "col", src: "src/st.gif" }
]
},
{ $type: "hr" },
{ $type: "h2", $text: "3. JSON as a JSON Query Language" },
{ $text: "Make complex API queries purely written in JSON." },
{ $type: "br" },
{ $text: "Since templates in ST are written in JSON, you can pass them around anywhere just like any other data object." },
{ $text: "Notice we're not creating some new query language, it's just JSON. No convoluted infrastructure to set up!" },
{ $type: "a", href: "https://github.com/SelectTransform/JSONQL", class: "btn btn-primary rectangle", $text: "Visit Github" },
{ $type: "br" },
{
class: "row", $components: [
{ $type: "img", class: "vertical", src: "src/jsonql1.png" },
{ $type: "img", class: "vertical", src: "src/jsonql2.png" }
]
},
{ $type: "hr" },
{ $type: "h2", $text: "4. App as Data" },
{ $html: "Templates are normally used for views" },
{ $html: "But the cool thing about JSON is it can be used to declaratively represent ANYTHING from Model to View to Controller." },
{ $type: "br" },
{ $html: "What if we set <b>executable functions</b> as leaf nodes of an object, select & transform it, and then auto-trigger the resolved function?" },
{ $text: "We have built a router in JSON!" },
{ $type: "br" },
{ $text: "Basically, the entire router logic is represented as a piece of data." },
{ $type: "br" },
{
class: "row", $components: [
{ class: "col", $inherit: "md", $file: "src/markdown/index/language_client.md" },
{ class: "col", $inherit: "md", $file: "src/markdown/index/language_server.md" },
]
},
{ $type: "hr" },
{ $type: "h2", $text: "5. Routerless Server" },
{ $html: "Let's take the router example from right above. Since our router logic is just a JSON (<code>router.json</code>), we don't even need it on the server side." },
{ $html: "What if we DON'T keep <code>router.json</code> on the server, but send it from the browser?" },
{
class: "row", $components: [
{ class: "col", $inherit: "md", $file: "src/markdown/index/portable_client.md" },
{ class: "col", $inherit: "md", $file: "src/markdown/index/portable_server.md" },
]
},
{ $html: "What's going on here?" },
{ $type: "br" },
{ $html: "We are looking at a server WITHOUT a router." },
{ $html: "Instead of implementing a router on the server, we send the router itself as part of a network request!" },
{ $type: "br" },
{ $html: "This type of JSON-powered portability provides extreme flexibility when creating interfaces for microservices and RPC endpoints" },
{ $type: "br" },
{ $html: "Also, remember that you can bake <a href='transform.html'>validation, conditionals, loops, etc.</a> all in a single JSON IPC/RPC call, which makes it extremely powerful and efficient." },
{ $type: "hr" },
{ $type: "h2", $text: "6. Build your OWN Turing complete JSON markup language!" },
{ $text: "If you read this far, you may feel like you could implement practically any programming concept in a declarative manner, using JSON." },
{ $html: "This is because ST.js is a low level building block for creating a <b>Turing Complete JSON markup language</b>" },
{ $type: "br" },
{ $html: "<code>st.js</code> is the core JSON parser that powers <a href='https://www.jasonette.com'>Jasonette</a>, a framework that lets you build native iOS/Android apps by writing nothing but a JSON markup." },
{ $type: "a", href: "https://www.jasonette.com", class: "btn btn-primary rectangle", $text: "Check out Jasonette" },
{ class: "vid", $components: [{
class: "video-container", $components: [{
$type: "iframe", width: "853", height: "480", src: "https://www.youtube.com/embed/hfevBAAfCMQ", frameborder: "0", allowfullscreen: "allowfullscreen"
}]
}]},
{ $type: "br" },
{ $text: "But Jasonette is just one implementation." },
{ $html: "Want to build your own turing complete JSON markup language?" },
{ $type: "br" },
{ $html: "Learn more about how Jasonette implements programming concepts by reading <a href='http://blog.jasonette.com/2017/02/15/functional-programming-in-json/'>this blog post</a>, and build your own using ST.js!" },
{ $type: "hr" },
{ $type: "h1", $text: "How to use" },
{ $inherit: "md", $file: "src/markdown/index/usage.md" },
{ $type: "hr" },
]
}
]
},
output: "index.html", js: mixin.js, css: mixin.css, init: mixin.init
}, {
input: {
$components: [
{ $type: "h1", class: "center", $text: "SELECT" },
{
class: "center", $components: [
{ $type: "a", href: "https://selecttransform.github.io/site", class: "btn btn-primary", $text: "Home" },
{ $type: "a", href: "https://github.com/SelectTransform/st.js", class: "btn btn-primary", $text: "Github" },
{ $type: "a", href: "https://selecttransform.github.io/playground/", class: "btn btn-primary", $text: "Try" },
{ $type: "a", href: "https://twitter.com/selecttransform", class: "btn btn-primary", $text: "Twitter" }
]
},
{
class: "container",
$components: [
{ $type: "h1", $text: "Syntax" },
{ class: "section", $inherit: "md", $file: "src/markdown/select/syntax.md" },
]
},
{
class: "container",
$components: [
{ $type: "h1", $text: "Example" },
{ class: "section", $inherit: "md", $file: "src/markdown/select/example.md" }
]
}
]
},
output: "select.html", js: mixin.js, css: mixin.css, init: mixin.init
}, {
input: {
$components: [
{ $type: "h1", class: "center", $text: "TRANSFORM" },
{
class: "center", $components: [
{ $type: "a", href: "https://selecttransform.github.io/site", class: "btn btn-primary", $text: "Home" },
{ $type: "a", href: "https://github.com/SelectTransform/st.js", class: "btn btn-primary", $text: "Github" },
{ $type: "a", href: "https://selecttransform.github.io/playground/", class: "btn btn-primary", $text: "Try" },
{ $type: "a", href: "https://twitter.com/selecttransform", class: "btn btn-primary", $text: "Twitter" }
]
},
{
class: "container",
$components: [
{ $type: "h1", $text: "API" },
{ $inherit: "md", $file: "src/markdown/transform/api.md" }
]
},
{
class: "container",
$components: [
{ $type: "h1", $text: "Syntax" },
{ $inherit: "md", $file: "src/markdown/transform/syntax.md" }
]
},
{
class: "container",
$components: [
{ $type: "h1", $text: "Examples" },
{ $inherit: "md", $file: "src/markdown/transform/examples.md" }
]
}
]
},
output: "transform.html", js: mixin.js, css: mixin.css, init: mixin.init
}]