Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tlack/qqq
www toolkit for q
https://github.com/tlack/qqq
Last synced: about 2 months ago
JSON representation
www toolkit for q
- Host: GitHub
- URL: https://github.com/tlack/qqq
- Owner: tlack
- Created: 2015-05-19T21:16:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-15T20:47:32.000Z (over 9 years ago)
- Last Synced: 2024-10-14T04:44:45.526Z (3 months ago)
- Language: JavaScript
- Size: 152 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
qqq.q: www toolkit for q
========================This is a toolkit of useful functions for those creating websites with Q and Kdb+.
This is not a framework and you don't have to use all of it. Feel free to mix this
with (.h)[http://code.kx.com/wiki/Doth), (.z.ph)[http://code.kx.com/wiki/Reference/dotzdotph],
etc.Included is an experimental approach to transforming Q data into an HTML tree structure. I've
also been experimenting with transmitting the raw Q data structures to the client via
(.z.ws)[http://code.kx.com/wiki/Reference/dotzdotws] and (Kx's own c.js)[http://kx.com/q/c/c.js],
then creating DOM elements using the excellent (https://github.com/Matt-Esch/virtual-dom]. This
approach has a lot of promise in terms of performance, expressivity, and productivity.Status
------Handy for my personal use, but not ready for prime time. Caveat emptor.
Usage
-----As a URL parser:
To extract handy data from the passed-in data to .z.ph:
```
\l qqq/qqq.q
.z.ph:{.qqq.parsereq[x]; otherstuff[]}
```Server-side DOM tree:
```
\l qqq/qqq.q
.z.ph:{.qqq.divv["Welcome to my humble website!"]}
```Copyright
---------MIT License. (c) Copyright 2015 @tlack
OLD Notes/thinking/observations
-------------------------------The following may be out of date:
Example single pager:
```
save: {reggedat:.z.P;
`users insert (x.name;reggedat);
div[`banner;"Welcome, you are user #",(string count users),"!"]
}
div (`banner;"Please login")
itext (`name; (`blur`placeholder)!(save;"Enter your username"))
.qqq.boot[]
```It outputs:
```html
qqq.bind('name')
// and later:
qqq.boot()```
Need to figure out
------------------How do we namespace "components" so I can compose pieces of the page into
a single unit, as a kind of programmatic "atomic design"?TODO
----Everything
Flexible calling syntax
-----------------------This allows us to get around the fact that Q doesn't allow optional arguments;
use a list as the argument list.```
func:{x[0] + x[1]}
func(1;2) = func[(1;2)]
```Handlers on elements
--------------------Let's try a pub-sub system based on Q symbol names - this can be tied easily to
Q variables or functions.