File tree 8 files changed +239
-125
lines changed
8 files changed +239
-125
lines changed Original file line number Diff line number Diff line change
1
+ repos :
2
+ - repo : https://github.com/rtts/djhtml
3
+ rev : ' 3.0.6'
4
+ hooks :
5
+ - id : djhtml
6
+ entry : djhtml --tabwidth 2 templates
Original file line number Diff line number Diff line change @@ -18,13 +18,17 @@ license = {text = "MIT"}
18
18
plugins = [" pdm-autoexport" ]
19
19
20
20
[tool .pdm .scripts ]
21
+ post_install = " pdm install --plugins; pre-commit install"
21
22
devserver = " flask --app app run --debug"
22
23
activate = " eval $(pdm venv activate)"
23
24
test = " pytest"
25
+ format = " djhtml --tabwidth 2 templates"
24
26
25
27
[tool .pdm .dev-dependencies ]
26
28
dev = [
27
29
" pytest>=7.4.3" ,
30
+ " djhtml>=3.0.6" ,
31
+ " pre-commit>=3.5.0" ,
28
32
]
29
33
30
34
[[tool .pdm .autoexport ]]
Original file line number Diff line number Diff line change 1
1
<!DOCTYPE html>
2
2
< html lang ="en " data-theme ="light ">
3
- < head >
3
+ < head >
4
4
< meta charset ="UTF-8 ">
5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
6
< link rel ="stylesheet " href ="https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css ">
7
7
< style type ="text/css ">
8
8
/* override some style in picocss */
9
- h1 , h2 , h3 , h4 , h5 , h6 ,
10
- p {
9
+ h1 , h2 , h3 , h4 , h5 , h6 ,
10
+ p {
11
11
margin-bottom : 0 ;
12
- }
12
+ }
13
13
</ style >
14
14
{% block head %}{% endblock %}
15
- </ head >
15
+ </ head >
16
16
17
- < body >
17
+ < body >
18
18
{% include 'components/github_ribbon.html' %}
19
19
{% block content %}{% endblock %}
20
- </ body >
20
+ </ body >
21
21
22
22
</ html >
Original file line number Diff line number Diff line change 62
62
}
63
63
64
64
.challenge-header__exerpt {
65
- margin-bottom : 1.5rem ;
66
- line-height : 1.5 ;
65
+ margin-bottom : 1.5rem ;
66
+ line-height : 1.5 ;
67
67
}
68
68
69
69
.challenge-main {
186
186
{%include 'components/badge.html' with context %}
187
187
</ div >
188
188
< p class ="challenge-header__exerpt ">
189
- Complete code on the left side following the instructions.< br >
190
- Right side is test code, lines followed by < code > # expect-type-error</ code >
191
- should fail type check, others should pass.< br >
192
- Hit the "▶️ Run" button to see result.
193
- </ p >
189
+ Complete code on the left side following the instructions.< br >
190
+ Right side is test code, lines followed by < code > # expect-type-error</ code >
191
+ should fail type check, others should pass.< br >
192
+ Hit the "▶️ Run" button to see result.
193
+ </ p >
194
194
</ div >
195
195
196
196
< div class ="challenge-main ">
199
199
< div id ="editor "> </ div >
200
200
< div class ="editor-actions ">
201
201
< button id ="reset-button " class ="secondary ">
202
- Reset
202
+ Reset
203
203
</ button >
204
204
< button id ="run-button ">
205
205
▶️ Run
Original file line number Diff line number Diff line change 1
1
2
2
< head >
3
- < style type ="text/css ">
4
- .badge {
5
- display : flex;
6
- align-items : center;
7
- justify-content : center;
8
- padding : 2px 4px ;
9
- margin-right : 4px ;
10
- height : 30px ;
11
- border-radius : 5px ;
12
- background-color : # 6cb8d4 ;
13
- color : white;
14
- font-size : 14px ;
15
- font-weight : bold;
16
- }
3
+ < style type ="text/css ">
4
+ .badge {
5
+ display : flex;
6
+ align-items : center;
7
+ justify-content : center;
8
+ padding : 2px 4px ;
9
+ margin-right : 4px ;
10
+ height : 30px ;
11
+ border-radius : 5px ;
12
+ background-color : # 6cb8d4 ;
13
+ color : white;
14
+ font-size : 14px ;
15
+ font-weight : bold;
16
+ }
17
17
18
- .badge a {
19
- color : white;
20
- }
18
+ .badge a {
19
+ color : white;
20
+ }
21
21
22
- .badge span : nth-child (2 ),
23
- .badge span a {
24
- font-weight : lighter;
25
- }
22
+ .badge span : nth-child (2 ),
23
+ .badge span a {
24
+ font-weight : lighter;
25
+ }
26
26
27
- .badge span : nth-child (1 ) svg {
28
- width : 16px ;
29
- height : 16px ;
30
- margin-right : 5px ;
31
- }
32
- </ style >
27
+ .badge span : nth-child (1 ) svg {
28
+ width : 16px ;
29
+ height : 16px ;
30
+ margin-right : 5px ;
31
+ }
32
+ </ style >
33
33
</ head >
34
34
35
35
36
36
< div class ="badge ">
37
- < span >
38
- < svg xmlns ="http://www.w3.org/2000/svg " width ="24 " height ="24 " viewBox ="0 0 256 255 "> < defs > < linearGradient id ="logosPython0 " x1 ="12.959% " x2 ="79.639% " y1 ="12.039% " y2 ="78.201% "> < stop offset ="0% " stop-color ="#387EB8 "/> < stop offset ="100% " stop-color ="#366994 "/> </ linearGradient > < linearGradient id ="logosPython1 " x1 ="19.128% " x2 ="90.742% " y1 ="20.579% " y2 ="88.429% "> < stop offset ="0% " stop-color ="#FFE052 "/> < stop offset ="100% " stop-color ="#FFC331 "/> </ linearGradient > </ defs > < path fill ="url(#logosPython0) " d ="M126.916.072c-64.832 0-60.784 28.115-60.784 28.115l.072 29.128h61.868v8.745H41.631S.145 61.355.145 126.77c0 65.417 36.21 63.097 36.21 63.097h21.61v-30.356s-1.165-36.21 35.632-36.21h61.362s34.475.557 34.475-33.319V33.97S194.67.072 126.916.072ZM92.802 19.66a11.12 11.12 0 0 1 11.13 11.13a11.12 11.12 0 0 1-11.13 11.13a11.12 11.12 0 0 1-11.13-11.13a11.12 11.12 0 0 1 11.13-11.13Z "/> < path fill ="url(#logosPython1) " d ="M128.757 254.126c64.832 0 60.784-28.115 60.784-28.115l-.072-29.127H127.6v-8.745h86.441s41.486 4.705 41.486-60.712c0-65.416-36.21-63.096-36.21-63.096h-21.61v30.355s1.165 36.21-35.632 36.21h-61.362s-34.475-.557-34.475 33.32v56.013s-5.235 33.897 62.518 33.897Zm34.114-19.586a11.12 11.12 0 0 1-11.13-11.13a11.12 11.12 0 0 1 11.13-11.131a11.12 11.12 0 0 1 11.13 11.13a11.12 11.12 0 0 1-11.13 11.13Z "/> </ svg >
39
- </ span >
40
- < span > {{ python_info }}</ span >
41
- </ div >
42
- < div class ="badge ">
43
- < span > type checker: < span >
44
37
< span >
45
- < a target ="_blank " rel ="noopener noreferrer " href ="https://github.com/microsoft/pyright ">
46
- pyright
47
- </ a >
38
+ < svg xmlns ="http://www.w3.org/2000/svg " width ="24 " height ="24 " viewBox ="0 0 256 255 "> < defs > < linearGradient id ="logosPython0 " x1 ="12.959% " x2 ="79.639% " y1 ="12.039% " y2 ="78.201% "> < stop offset ="0% " stop-color ="#387EB8 "/> < stop offset ="100% " stop-color ="#366994 "/> </ linearGradient > < linearGradient id ="logosPython1 " x1 ="19.128% " x2 ="90.742% " y1 ="20.579% " y2 ="88.429% "> < stop offset ="0% " stop-color ="#FFE052 "/> < stop offset ="100% " stop-color ="#FFC331 "/> </ linearGradient > </ defs > < path fill ="url(#logosPython0) " d ="M126.916.072c-64.832 0-60.784 28.115-60.784 28.115l.072 29.128h61.868v8.745H41.631S.145 61.355.145 126.77c0 65.417 36.21 63.097 36.21 63.097h21.61v-30.356s-1.165-36.21 35.632-36.21h61.362s34.475.557 34.475-33.319V33.97S194.67.072 126.916.072ZM92.802 19.66a11.12 11.12 0 0 1 11.13 11.13a11.12 11.12 0 0 1-11.13 11.13a11.12 11.12 0 0 1-11.13-11.13a11.12 11.12 0 0 1 11.13-11.13Z "/> < path fill ="url(#logosPython1) " d ="M128.757 254.126c64.832 0 60.784-28.115 60.784-28.115l-.072-29.127H127.6v-8.745h86.441s41.486 4.705 41.486-60.712c0-65.416-36.21-63.096-36.21-63.096h-21.61v30.355s1.165 36.21-35.632 36.21h-61.362s-34.475-.557-34.475 33.32v56.013s-5.235 33.897 62.518 33.897Zm34.114-19.586a11.12 11.12 0 0 1-11.13-11.13a11.12 11.12 0 0 1 11.13-11.131a11.12 11.12 0 0 1 11.13 11.13a11.12 11.12 0 0 1-11.13 11.13Z "/> </ svg >
48
39
</ span >
40
+ < span > {{ python_info }}</ span >
49
41
</ div >
42
+ < div class ="badge ">
43
+ < span > type checker: < span >
44
+ < span >
45
+ < a target ="_blank " rel ="noopener noreferrer " href ="https://github.com/microsoft/pyright ">
46
+ pyright
47
+ </ a >
48
+ </ span >
49
+ </ div >
You can’t perform that action at this time.
0 commit comments