From 5feb3d584f3869436237ebc708943b41510e7f30 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 4 Oct 2018 18:31:09 +0200 Subject: [PATCH 1/4] Stabilize disable-minification option --- src/librustdoc/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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") From ccc88a2751273ee81d2a7d1290643639a2237a83 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 29 Nov 2018 22:37:30 +0100 Subject: [PATCH 2/4] Add doc for `disable-minification` option --- src/doc/rustdoc/src/unstable-features.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index 3938df1a68267..9fa506c67a5e8 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -455,3 +455,7 @@ Some methodology notes about what rustdoc counts in this metric: Public items that are not documented can be seen with the built-in `missing_docs` lint. Private items that are not documented can be seen with Clippy's `missing_docs_in_private_items` lint. + +### `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, it's also a lot harder to read them. This feature allows you to prevent it. From c339f215b440ecc919eeae7fd32a3af1dc12cc35 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 23 May 2019 11:50:50 +0200 Subject: [PATCH 3/4] Reword disable-minification a bit and move it to the command-line-arguments file --- src/doc/rustdoc/src/command-line-arguments.md | 6 ++++++ src/doc/rustdoc/src/unstable-features.md | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) 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/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index 9fa506c67a5e8..3938df1a68267 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -455,7 +455,3 @@ Some methodology notes about what rustdoc counts in this metric: Public items that are not documented can be seen with the built-in `missing_docs` lint. Private items that are not documented can be seen with Clippy's `missing_docs_in_private_items` lint. - -### `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, it's also a lot harder to read them. This feature allows you to prevent it. From 834261fd8696dffda1115afdf2215dbcd53975ae Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 24 May 2019 10:43:15 +0200 Subject: [PATCH 4/4] Add test for minification disablement --- src/test/rustdoc/disable-minification.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/test/rustdoc/disable-minification.rs 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() {}