File tree 3 files changed +25
-18
lines changed
3 files changed +25
-18
lines changed Original file line number Diff line number Diff line change @@ -24,23 +24,12 @@ An if is a conditional.
24
24
25
25
A for loop is a loop.
26
26
27
- <!-- <div class="editor-container p-3 pt-0">
28
- <button id="run-button" class="btn btn-primary my-3">Run</button>
29
- <button data-bs-toggle="tooltip" data-bs-placement="right" data-bs-original-title="Clicking this will restart the Python interpreter, so be careful!" id="terminate-button" class="btn btn-danger my-3 ms-2">Terminate Pyodide</button>
30
- <div id="editor"></div>
31
- <div class="mt-3 input-output-container">
32
- <div data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Input" class="d-block position-relative input-container">
33
- <textarea id="input-tmp" class="input"></textarea>
34
- </div>
35
- <div id="output" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Output" class="output-container">
36
-
37
- </div>
38
- </div>
39
- </div> -->
40
-
41
27
<div is =" code-editor " id =" editor-1 " >
42
28
for i in range(5):
43
29
print(i)
30
+ #####
31
+ a
32
+ a
44
33
</div >
45
34
46
35
<div is =" code-editor " id =" editor-2 " >
Original file line number Diff line number Diff line change @@ -6,13 +6,25 @@ class CodeEditor extends HTMLDivElement {
6
6
7
7
this . setAttribute ( "class" , "editor-container p-3 pt-0" )
8
8
9
+ let code_and_input = this . innerHTML . trim ( ) ;
10
+ let code = '' ;
11
+ let input = '' ;
12
+
13
+ if ( ! code_and_input . includes ( '#####' ) ) {
14
+ code = code_and_input ;
15
+ } else {
16
+ code_and_input = code_and_input . split ( '#####' ) ;
17
+ code = code_and_input [ 0 ] . trim ( ) ;
18
+ input = code_and_input [ 1 ] . trim ( ) ;
19
+ }
20
+
9
21
this . innerHTML = `
10
22
<button id="run-button-${ id } " class="btn btn-primary my-3">Run</button>
11
23
<button id="terminate-button-${ id } " data-bs-toggle="tooltip" data-bs-placement="right" data-bs-original-title="Clicking this will restart the Python interpreter, so be careful!" class="btn btn-danger my-3 ms-2">Terminate Pyodide</button>
12
- <div class="editor" id="ace-editor-${ id } ">${ this . innerHTML } </div>
24
+ <div class="editor" id="ace-editor-${ id } ">${ code } </div>
13
25
<div class="mt-3 input-output-container">
14
26
<div data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Input" class="d-block position-relative input-container">
15
- <textarea id="input-${ id } " class="input"></textarea>
27
+ <textarea id="input-${ id } " class="input">${ input } </textarea>
16
28
</div>
17
29
<div id="output-${ id } " data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Output" class="output-container">
18
30
Original file line number Diff line number Diff line change @@ -6,7 +6,13 @@ current_page: lessons
6
6
7
7
# Lessons
8
8
9
- <ul class =" nav nav-pills mb-3 " id =" pills-tab " role =" tablist " >
9
+ <div >
10
+ {% for post in site.posts %}
11
+ <h4 ><a class =" text-light text-opacity-75 " href =" {{ post.url }} " >{{ post.title }}</a ></h4 >
12
+ {% endfor %}
13
+ </div >
14
+
15
+ <!-- <ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
10
16
<li class="nav-item" role="presentation">
11
17
<button class="nav-link active" id="pills-home-tab" data-bs-toggle="pill" data-bs-target="#pills-all"
12
18
type="button">All Lessons</button>
@@ -55,4 +61,4 @@ current_page: lessons
55
61
{% endif %}
56
62
{% endfor %}
57
63
</div>
58
- </div >
64
+ </div>-->
You can’t perform that action at this time.
0 commit comments