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 @@ -630,6 +630,8 @@ pub struct Playground {
630
630
pub copy_js : bool ,
631
631
/// Display line numbers on playground snippets. Default: `false`.
632
632
pub line_numbers : bool ,
633
+ /// Display the run button. Default: `true`
634
+ pub runnable : bool ,
633
635
}
634
636
635
637
impl Default for Playground {
@@ -639,6 +641,7 @@ impl Default for Playground {
639
641
copyable : true ,
640
642
copy_js : true ,
641
643
line_numbers : false ,
644
+ runnable : true ,
642
645
}
643
646
}
644
647
}
@@ -781,6 +784,7 @@ mod tests {
781
784
copyable : true ,
782
785
copy_js : true ,
783
786
line_numbers : false ,
787
+ runnable : true ,
784
788
} ;
785
789
let html_should_be = HtmlConfig {
786
790
curly_quotes : true ,
Original file line number Diff line number Diff line change @@ -828,7 +828,8 @@ fn add_playground_pre(
828
828
if classes. contains ( "language-rust" ) {
829
829
if ( !classes. contains ( "ignore" )
830
830
&& !classes. contains ( "noplayground" )
831
- && !classes. contains ( "noplaypen" ) )
831
+ && !classes. contains ( "noplaypen" )
832
+ && playground_config. runnable )
832
833
|| classes. contains ( "mdbook-runnable" )
833
834
{
834
835
let contains_e2015 = classes. contains ( "edition2015" ) ;
You can’t perform that action at this time.
0 commit comments