-
Notifications
You must be signed in to change notification settings - Fork 4
/
sample.poly
99 lines (73 loc) · 1.89 KB
/
sample.poly
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
%%poly~
~---
maybe other meta stuff here?
styles? directives?
---~
python1 = Kernel(language="python", executable="/usr/bin/env python")
R1 = Kernel(language="R", executable="/usr/bin/env /R")
shell1 = Kernel(language="bash", executable="/bin/bash")
/%%
%%shell1
a=10
/%%
%%markdown~
~---
stylesheet: sleek
imports:
a: shell1.a
---~
This section can be markdown.
`this is normal displayed code`.
This is executed code: ${a}.
The syntax for executed code is simply javascript literals.
```python
This is a normal block (not executed)
displayed code (here python syntax highlighted)
```
Or even latex $\frac{1}{\sqrt{\sigma}}$.
Or variables can be accessed by namespace.
In `shell1`, `a` has the value ${shell.a}.
The current directory is $bash{pwd}.
/%%
%%html~
~---
stylesheet: style.css
---~
This section contains html and even
<javascript>
embedded scripts
</javascript>
as well as displayed code <code>cat("hello")</code>
or executed inline code <inline bash>a="hello"; echo "$a"</inline> that does not
affect other kernels.
or displayed variables such as in shell1, a=<inline shell1>echo "$a"</inline>
/%%
Anything outside of a defined block is ignored. Essentially,
this is where comments go.
Quick code blocks can be made by.
%%python
print("this is a frame not associated with a particular kernel")
/%%
You can import variables by doing:
%%R1~
~---
imports:
myvar: shell1.var1
the_title: shell1.a
data: python1.data
stdout: hide
stderr: show
graphics: inline
---~
plot(data);
title(the_title);
/%%
Import equivalencies can be defined:
data.table <==> DataFrame (Python), Object (JS), TSV (bash)
string <==> string
int <==> int
Array <==> List, Array, etc.
Dict <==> JS object (JS), nested named lists (R), YAML, XML
etc.
Need definition scheme.
int, float, string, array, dict, table