/
index.co
executable file
·32 lines (30 loc) · 1.15 KB
/
index.co
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
# Ckup [demo](index.html) written in Ckup, spat simply to stdout.
console.log \%s, require(\ckup).render ->
@doctype \html
@meta charset: \utf-8
@title 'ckup demo'
@link rel: \stylesheet, href: \index.css
@link rel: \icon , href: \ckup.png
@textarea id: \kup, []='''
doctype \\html
html ->
head ->
meta charset: \\utf-8
body ->
code $ 'coco> '
strong -> text '"Hello, world!"'
'''
@button id: \run, title: \render, []=' ↓ ' #v
@a id: \doc, href : \docs.htm, []=' ? ' #?
@button id: \url, title: \open, []=' ↗ ' #/
@textarea id: \htm
@script src: \https://github.com/satyr/coco/raw/master/extras/coco.js
@script src: \ckup.js
@script 'new ' + ->
@[id] = document.getElementById id for id of <[ kup run url htm ]>
@run.onclick = => @htm.value = Ckup.render @kup.value
@url.onclick = => open 'data:text/html,' + @htm.value
@a href: \https://github.com/satyr/ckup, -> @img do
alt: \fork-me-on-github
src: \http://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png
style: 'position:absolute; top:0; right:0; border:0; z-index:9'