Commit 84a0a07 1 parent fe6a9b0 commit 84a0a07 Copy full SHA for 84a0a07
File tree 2 files changed +43
-0
lines changed
2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,12 @@ $('body').terminal({
215
215
216
216
If you type ` h ` and press ` <TAB> ` it will complete the command and insert ` ello ` .
217
217
218
+ ## Demo
219
+
220
+ import CodePen from ' @site/src/CodePen' ;
221
+
222
+ <CodePen id = " EaYWYMp" title = " Basic terminal" />
223
+
218
224
## See also
219
225
220
226
* [ What you can echo?] ( #??? )
Original file line number Diff line number Diff line change
1
+ import { useEffect } from 'react' ;
2
+
3
+ type CodePenProps = {
4
+ id : string ;
5
+ title : string ;
6
+ } ;
7
+
8
+ export default function CodePen ( { id, title } : CodePenProps ) {
9
+ useEffect ( ( ) => {
10
+ const script = document . createElement ( 'script' ) ;
11
+ script . src = 'https://cpwebassets.codepen.io/assets/embed/ei.js' ;
12
+ script . async = true ;
13
+ document . body . appendChild ( script ) ;
14
+ } , [ ] ) ;
15
+ return (
16
+ < p className = "codepen"
17
+ data-height = "300"
18
+ data-default-tab = "result"
19
+ data-slug-hash = { id }
20
+ data-pen-title = { title }
21
+ data-user = "jcubic"
22
+ style = { {
23
+ height : 300 ,
24
+ boxSizing : 'border-box' ,
25
+ display : 'flex' ,
26
+ alignItems : 'center' ,
27
+ justifyContent : 'center' ,
28
+ border : '2px solid' ,
29
+ margin : '1em 0' ,
30
+ padding : '1em'
31
+ } } >
32
+ < span > See the Pen < a href = { `https://codepen.io/jcubic/pen/${ id } ` } >
33
+ { title } </ a > by Jakub T. Jankiewicz (< a href = "https://codepen.io/jcubic" > @jcubic</ a > )
34
+ { ' ' } on < a href = "https://codepen.io" > CodePen</ a > .</ span >
35
+ </ p >
36
+ ) ;
37
+ }
You can’t perform that action at this time.
0 commit comments