File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -630,6 +630,8 @@ pub struct Playground {
630630 pub copy_js : bool ,
631631 /// Display line numbers on playground snippets. Default: `false`.
632632 pub line_numbers : bool ,
633+ /// Display the run button. Default: `true`
634+ pub runnable : bool ,
633635}
634636
635637impl Default for Playground {
@@ -639,6 +641,7 @@ impl Default for Playground {
639641 copyable : true ,
640642 copy_js : true ,
641643 line_numbers : false ,
644+ runnable : true ,
642645 }
643646 }
644647}
@@ -781,6 +784,7 @@ mod tests {
781784 copyable : true ,
782785 copy_js : true ,
783786 line_numbers : false ,
787+ runnable : true ,
784788 } ;
785789 let html_should_be = HtmlConfig {
786790 curly_quotes : true ,
Original file line number Diff line number Diff line change @@ -828,7 +828,8 @@ fn add_playground_pre(
828828 if classes. contains ( "language-rust" ) {
829829 if ( !classes. contains ( "ignore" )
830830 && !classes. contains ( "noplayground" )
831- && !classes. contains ( "noplaypen" ) )
831+ && !classes. contains ( "noplaypen" )
832+ && playground_config. runnable )
832833 || classes. contains ( "mdbook-runnable" )
833834 {
834835 let contains_e2015 = classes. contains ( "edition2015" ) ;
You can’t perform that action at this time.
0 commit comments