11const gitCommitDirective = {
2- name : " gitCommitCheckpoint" ,
3- doc : " Renders a consistent callout when the learner should do a Git commit." ,
2+ name : ' gitCommitCheckpoint' ,
3+ doc : ' Renders a consistent callout when the learner should do a Git commit.' ,
44 arg : {
55 type : String ,
6- doc : " Commit message" ,
6+ doc : ' Commit message' ,
77 } ,
88 run ( data ) {
99 return [ {
10- type : " admonition" ,
11- kind : " important" ,
10+ type : ' admonition' ,
11+ kind : ' important' ,
1212 icon : false ,
1313 children : [
1414 {
15- type : " admonitionTitle" ,
15+ type : ' admonitionTitle' ,
1616 children : [ {
17- type : " text" ,
18- value : " 💾 Commit & push to GitHub" ,
17+ type : ' text' ,
18+ value : ' 💾 Commit & push to GitHub' ,
1919 } ] ,
2020 } ,
2121 {
22- type : " code" ,
23- lang : " bash" ,
24- value : `git add .\ngit commit -m " ${ data . arg } " \ngit push -u origin main` ,
22+ type : ' code' ,
23+ lang : ' bash' ,
24+ value : `git add .\ngit commit -m ' ${ data . arg } ' \ngit push -u origin main` ,
2525 } ,
2626 ] ,
2727 } ] ;
2828 } ,
2929} ;
3030
3131const youShouldNoticeDirective = {
32- name : " youShouldNotice" ,
33- doc : " Renders a consistent callout when the learner should notice something." ,
32+ name : ' youShouldNotice' ,
33+ doc : ' Renders a consistent callout when the learner should notice something.' ,
3434 body : {
3535 type : 'myst' ,
3636 } ,
3737 run ( data ) {
3838 return [ {
39- type : " admonition" ,
40- kind : " important" ,
39+ type : ' admonition' ,
40+ kind : ' important' ,
4141 icon : false ,
42- class : " simple" ,
42+ class : ' simple' ,
4343 children : [
4444 {
45- type : " admonitionTitle" ,
45+ type : ' admonitionTitle' ,
4646 children : [ {
47- type : " text" ,
48- value : " 👀 You should notice..." ,
47+ type : ' text' ,
48+ value : ' 👀 You should notice...' ,
4949 } ] ,
5050 } ,
5151 ...data . body ,
@@ -54,9 +54,43 @@ const youShouldNoticeDirective = {
5454 } ,
5555} ;
5656
57+ const mystDemoStatic = {
58+ name : 'myst:static' ,
59+ doc : 'A static/pre-rendered version of the `{myst}` directive which supports plugins.' ,
60+ body : {
61+ type : 'myst' ,
62+ } ,
63+ run ( data ) {
64+ return [
65+ {
66+ type : "div" ,
67+ class : "myst-static-input-wrapper" ,
68+ children : [ {
69+ type : "div" ,
70+ class : "myst-static-content" ,
71+ children : [ {
72+ type : "code" ,
73+ language : "text" ,
74+ value : data . node . value ,
75+ } ] ,
76+ } ] ,
77+ } ,
78+ {
79+ type : "div" ,
80+ class : "myst-static-output-wrapper" ,
81+ children : [ {
82+ type : "div" ,
83+ class : "myst-static-content" ,
84+ children : data . body ,
85+ } ] ,
86+ } ,
87+ ] ;
88+ } ,
89+ } ;
90+
5791const plugin = {
58- name : " Our custom functionality" ,
59- doc : " Custom functionality for this workshop website" ,
60- directives : [ gitCommitDirective , youShouldNoticeDirective ] ,
92+ name : ' Our custom functionality' ,
93+ doc : ' Custom functionality for this workshop website' ,
94+ directives : [ gitCommitDirective , youShouldNoticeDirective , mystDemoStatic ] ,
6195}
6296export default plugin ;
0 commit comments