File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -622,6 +622,8 @@ pub struct Playground {
622
622
pub copy_js : bool ,
623
623
/// Display line numbers on playground snippets. Default: `false`.
624
624
pub line_numbers : bool ,
625
+ /// Display the run button. Default: `true`
626
+ pub runnable : bool ,
625
627
}
626
628
627
629
impl Default for Playground {
@@ -631,6 +633,7 @@ impl Default for Playground {
631
633
copyable : true ,
632
634
copy_js : true ,
633
635
line_numbers : false ,
636
+ runnable : true ,
634
637
}
635
638
}
636
639
}
@@ -773,6 +776,7 @@ mod tests {
773
776
copyable : true ,
774
777
copy_js : true ,
775
778
line_numbers : false ,
779
+ runnable : true ,
776
780
} ;
777
781
let html_should_be = HtmlConfig {
778
782
curly_quotes : true ,
Original file line number Diff line number Diff line change @@ -826,7 +826,8 @@ fn add_playground_pre(
826
826
if classes. contains ( "language-rust" ) {
827
827
if ( !classes. contains ( "ignore" )
828
828
&& !classes. contains ( "noplayground" )
829
- && !classes. contains ( "noplaypen" ) )
829
+ && !classes. contains ( "noplaypen" )
830
+ && playground_config. runnable )
830
831
|| classes. contains ( "mdbook-runnable" )
831
832
{
832
833
let contains_e2015 = classes. contains ( "edition2015" ) ;
You can’t perform that action at this time.
0 commit comments