@@ -6,33 +6,51 @@ import { CodePen, Gist, Tweet, YouTube, CodeSandbox } from 'mdx-embed'
6
6
function Repl ( { id } : { id : string } ) {
7
7
return (
8
8
< >
9
- < iframe
10
- title = { `repl-${ id } ` }
11
- height = "400px"
12
- width = "100%"
13
- src = { `https://repl.it/${ id } ?lite=true` }
14
- scrolling = "no"
15
- frameBorder = "no"
16
- allowFullScreen = { true }
17
- sandbox = "allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"
18
- />
9
+ < details >
10
+ < summary > Show Repl</ summary >
11
+ < iframe
12
+ title = { `repl-${ id } ` }
13
+ height = "400px"
14
+ width = "100%"
15
+ src = { `https://repl.it/${ id } ?lite=true` }
16
+ scrolling = "no"
17
+ frameBorder = "no"
18
+ allowFullScreen = { true }
19
+ sandbox = "allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"
20
+ />
21
+ </ details >
19
22
</ >
20
23
)
21
24
}
22
25
23
26
function Glitch ( { id } : { id : string } ) {
24
27
return (
25
- < div
26
- className = "glitch-embed-wrap"
27
- style = { { height : '420px' , width : '100%' } }
28
- >
29
- < iframe
30
- src = { `https://glitch.com/embed/#!/embed/${ id } ` }
31
- title = "probable-stellar-gull on Glitch"
32
- allow = "geolocation; microphone; camera; midi; vr; encrypted-media"
33
- style = { { height : '100%' , width : '100%' , border : 0 } }
34
- > </ iframe >
35
- </ div >
28
+ < details >
29
+ < summary > Show Glitch</ summary >
30
+ < div
31
+ className = "glitch-embed-wrap"
32
+ style = { { height : '420px' , width : '100%' } }
33
+ >
34
+ < iframe
35
+ src = { `https://glitch.com/embed/#!/embed/${ id } ` }
36
+ title = "probable-stellar-gull on Glitch"
37
+ allow = "geolocation; microphone; camera; midi; vr; encrypted-media"
38
+ style = { { height : '100%' , width : '100%' , border : 0 } }
39
+ > </ iframe >
40
+ </ div >
41
+ </ details >
42
+ )
43
+ }
44
+
45
+ function Video ( { id } : { id : string } ) {
46
+ return (
47
+ < details >
48
+ < summary > Show Video</ summary >
49
+ < video controls >
50
+ < source src = { id } type = "video/mp4" />
51
+ Your browser does not support the video tag.
52
+ </ video >
53
+ </ details >
36
54
)
37
55
}
38
56
@@ -56,22 +74,48 @@ export default function Markdown(props: {
56
74
component : Pre ,
57
75
} ,
58
76
CodePen : {
59
- component : ( { id } : { id : string } ) => < CodePen codePenId = { id } /> ,
77
+ component : ( { id } : { id : string } ) => (
78
+ < details >
79
+ < summary > Show CodePen</ summary >
80
+ < CodePen codePenId = { id } />
81
+ </ details >
82
+ ) ,
60
83
} ,
61
84
Gist : {
62
- component : ( { id } : { id : string } ) => < Gist gistLink = { id } /> ,
85
+ component : ( { id } : { id : string } ) => (
86
+ < details >
87
+ < summary > Show GitHub Gist</ summary >
88
+ < Gist gistLink = { id } />
89
+ </ details >
90
+ ) ,
63
91
} ,
64
92
Tweet : {
65
- component : ( { id } : { id : string } ) => < Tweet tweetLink = { id } /> ,
93
+ component : ( { id } : { id : string } ) => (
94
+ < details >
95
+ < summary > Show Tweet</ summary >
96
+ < Tweet tweetLink = { id } />
97
+ </ details >
98
+ ) ,
66
99
} ,
67
100
YouTube : {
68
- component : ( { id } : { id : string } ) => < YouTube youTubeId = { id } /> ,
101
+ component : ( { id } : { id : string } ) => (
102
+ < details >
103
+ < summary > Show YouTube video</ summary >
104
+ < YouTube youTubeId = { id } />
105
+ </ details >
106
+ ) ,
69
107
} ,
70
108
CodeSandbox : {
71
109
component : ( { id } : { id : string } ) => (
72
- < CodeSandbox codeSandboxId = { id } />
110
+ < details >
111
+ < summary > Show CodeSandbox</ summary >
112
+ < CodeSandbox codeSandboxId = { id } />
113
+ </ details >
73
114
) ,
74
115
} ,
116
+ Video : {
117
+ component : Video ,
118
+ } ,
75
119
Repl : {
76
120
component : Repl ,
77
121
} ,
0 commit comments