Giter Club home page Giter Club logo

qqq's Introduction

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:

<header-stuff/>
<script src="qqq.js"></script>
<input type="text" name="name" id="qqq-name" 
	placeholder="Enter your username">
<script>
qqq.bind('name')
</script>
<other-content/>
<script>
// and later:
qqq.boot()
</script>

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.

qqq's People

Contributors

tlack avatar

Watchers

none-p avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.