File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -235,6 +235,22 @@ fun main(args: Array<String>) {
235235
236236</div >
237237
238+ <div class =" kotlin-code " data-target-platform =" swift-export " data-version =" 2.0.0-RC3 " theme =" kotlin-docs " >
239+
240+ ``` kotlin
241+ fun mul (a : Int , b : Int ): Int {
242+ return a * b
243+ }
244+
245+ fun main (args : Array <String >) {
246+ print (mul(- 2 , 4 ))
247+ println (" + 7 =" )
248+ print (mul(- 2 , 4 ) + 7 )
249+ }
250+ ```
251+
252+ </div >
253+
238254Use ` data-target-platform ` attribute with value ` junit ` for creating examples with tests:
239255
240256<div class =" kotlin-code " data-target-platform =" junit " >
Original file line number Diff line number Diff line change @@ -515,7 +515,8 @@ export default class ExecutableFragment extends ExecutableCodeTemplate {
515515 ( elt ) => code . parentNode . replaceChild ( elt , code ) ,
516516 {
517517 mode : 'swift' ,
518- readOnly : 'nocursorgit st' ,
518+ readOnly : 'nocursor' ,
519+ scrollbarStyle : 'native' ,
519520 theme : this . state . theme ,
520521 value : code . innerText ,
521522 } ,
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ $wt-color-athens: #eaeaec;
2424$wt-color-azure : #167dff ;
2525
2626.executable-fragment-wrapper {
27+ --playground-code-output-padding : 10px ;
28+
2729 margin-bottom : 35px ;
2830 position : relative ;
2931
@@ -274,7 +276,7 @@ $wt-color-azure: #167dff;
274276 flex-grow : 1 ;
275277 font-family : $font-family-mono ;
276278 overflow : auto ;
277- padding-left : 10px ;
279+ padding-left : var ( --playground-code-output-padding , 10px ) ;
278280 padding-top : 15px ;
279281}
280282
@@ -560,3 +562,8 @@ div[label]:hover:after {
560562 color : black ;
561563 border : 1px solid $wt-color-code ;
562564}
565+
566+ .code-output .CodeMirror {
567+ margin-left : calc (-1 * var (--playground-code-output-padding ));
568+ padding-left : var (--playground-code-output-padding );
569+ }
You can’t perform that action at this time.
0 commit comments