diff --git a/src/doc/rustdoc/src/command-line-arguments.md b/src/doc/rustdoc/src/command-line-arguments.md index aba485f752ab2..fcab2037634f0 100644 --- a/src/doc/rustdoc/src/command-line-arguments.md +++ b/src/doc/rustdoc/src/command-line-arguments.md @@ -359,3 +359,9 @@ This flag allows rustdoc to treat your rust code as the given edition. It will c the given edition as well. As with `rustc`, the default edition that `rustdoc` will use is `2015` (the first edition). +### `disable-minification`: prevent minification of CSS and JS files + +By default, all JS and CSS files are minified in order to make them smaller. However, +sometimes there are bugs in the minification process, or the files are harder to read +when this happens. Passing this flag to rustdoc skips the minifier, passing the original +JS and CSS all the way into the final output. diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index f11e268b9092c..438e610e28b10 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -286,7 +286,7 @@ fn opts() -> Vec { "How errors and other messages are produced", "human|json|short") }), - unstable("disable-minification", |o| { + stable("disable-minification", |o| { o.optflag("", "disable-minification", "Disable minification applied on JS files") diff --git a/src/test/rustdoc/disable-minification.rs b/src/test/rustdoc/disable-minification.rs new file mode 100644 index 0000000000000..810916d945bd9 --- /dev/null +++ b/src/test/rustdoc/disable-minification.rs @@ -0,0 +1,10 @@ +// compile-flags:--disable-minification + +// @has search-index.js +// @!has - 'var R' + +/// The quick brown fox jumps over the lazy dog. +pub struct SomeStruct; + +/// The quick brown fox jumps over the lazy dog. +pub fn some_fn() {}