Skip to content

Commit c5d9186

Browse files
committed
Merge branch 'master' into prototypical_getsets_mappingproxy
2 parents 581daf9 + 4b86a6f commit c5d9186

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1072
-192
lines changed

HACKING.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -893,12 +893,14 @@ and the non-module version. First off, the call to Sk.configure
893893
contains another key value pair which sets up a specialized read
894894
function. This is the function that is responsible for returning your
895895
module out of the large array of files that are contained in the
896-
skulpt-stdlib.js file. You will see that all of the modules are
896+
`skulpt-stdlib.js` file. You will see that all of the modules are
897897
contained in this one file, stored in a big JSON structure. The extra
898-
key value pair is: read: builtinRead
898+
key value pair is: `read: builtinRead`
899899

900900
The read function is just for loading modules and is called when you do
901-
an import statement of some kind. In this case the function accesses the
901+
an import statement of some kind. This is an optional argument to `Sk.configure`,
902+
the default implementation is as above. You can of course override this function
903+
to implement bespoke module loading. In the default case the function accesses the
902904
variable builtinFiles which is created from the skulpt-stdlib.js file.
903905
The other difference, of course, is that you have to include
904906
skulpt-stdlib.js in your html file. Note that skulpt-stdlib.js must be

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Building Skulpt is straightforward:
5454
2. Install node.js
5555
3. Install the required dependencies using `npm install`
5656
4. Navigate to the repository and run `npm run dist`
57-
5. The tests should run and you will find `skulpt.min.js` and `skulpt-stdlib.js` in the `dist`folder
57+
5. The tests should run and you will find `skulpt.min.js` and `skulpt-stdlib.js` in the `dist` folder
5858

5959

6060
### Contributing

example/ipython.css

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
.container {
2+
display: flex;
3+
flex-direction: column;
4+
min-height: 400px;
5+
max-height: 80vh;
6+
margin: auto;
7+
width: 80vw;
8+
}
9+
#clickGuard {
10+
flex-grow: 1;
11+
}
12+
13+
#editor {
14+
min-height: 30px;
15+
padding: 7px;
16+
overflow: scroll;
17+
}
18+
#editor > div {
19+
min-height: 15px;
20+
max-height: 200vh;
21+
width: 100%;
22+
}
23+
#editor > div > .ace_gutter-cell:first-child {
24+
margin-left: 0px;
25+
}
26+
27+
.ace_gutter-cell {
28+
visibility: hidden;
29+
padding-left: 0;
30+
padding-right: 13px;
31+
}
32+
33+
.in-gutter::before {
34+
content: "In [";
35+
}
36+
.out-gutter::after,
37+
.in-gutter::after {
38+
content: "]:";
39+
position: absolute;
40+
right: 0;
41+
}
42+
.out-gutter::before {
43+
content: "Out[";
44+
}
45+
.out-gutter::before,
46+
.in-gutter::before {
47+
position: absolute;
48+
left: 5px;
49+
padding: 0;
50+
}
51+
52+
.out-gutter,
53+
.in-gutter {
54+
padding-left: 30px;
55+
visibility: visible;
56+
display: block;
57+
}
58+
59+
.in-gutter {
60+
color: mediumseagreen;
61+
}
62+
.out-gutter {
63+
color: crimson;
64+
}
65+
.ace_gutter {
66+
font-size: 11px;
67+
}
68+
.ace_gutter-cell:not(:first-child):after {
69+
content: "...:";
70+
visibility: visible;
71+
position: absolute;
72+
right: 0;
73+
color: mediumseagreen;
74+
}

example/ipython.html

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<script src="../dist/skulpt.min.js" type="text/javascript"></script>
2+
<script src="../dist/skulpt-stdlib.js" type="text/javascript"></script>
3+
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.11/ace.min.js"></script>
4+
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.11/mode-python.min.js"></script>
5+
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.11/theme-gruvbox.min.js"></script>
6+
<script src="ipython.js"></script>
7+
<link rel="stylesheet" type="text/css" href="ipython.css"/>
8+
9+
<script>
10+
// must run "npm run build" before using this example
11+
var ide;
12+
window.addEventListener("load", function (event) {
13+
var editor = document.getElementById("editor");
14+
ide = new ipythonExample(editor);
15+
})
16+
</script>
17+
18+
<div class="container ace-gruvbox ace_editor">
19+
<div id="editor" class="ace-gruvbox ace_editor" style="font-size: 10px;"> </div>
20+
<div id="clickGuard"></div>
21+
</div>
22+

0 commit comments

Comments
 (0)