Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 11 pull requests #66483

Closed
wants to merge 44 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
75ab3a8
Stabilize rustdoc theme options
GuillaumeGomez Oct 1, 2018
272799f
Add documentation for stabilized flags
GuillaumeGomez May 23, 2019
ca64df5
Warn instead of failing for themes
GuillaumeGomez May 23, 2019
10e6ca6
Apply review comments
GuillaumeGomez May 24, 2019
8df4ce2
add test for rustdoc's --themes flag
QuietMisdreavus May 24, 2019
2aa57e9
Prevent invalid html characters in themes name
GuillaumeGomez Jun 30, 2019
5b2862c
Add sentence to tell other options are ignored when running check-theme
GuillaumeGomez Jun 30, 2019
2f535a4
Rename theme-checker option to check-theme
GuillaumeGomez Jun 30, 2019
29494a8
Fix typos
GuillaumeGomez Jul 26, 2019
b65a369
Improve documentation, add checks for themes option arguments, make s…
GuillaumeGomez Aug 21, 2019
c45a553
rename check-theme option into check-themes
GuillaumeGomez Sep 14, 2019
747dcaf
remove unstable docs
GuillaumeGomez Sep 14, 2019
94b21eb
Rename rustdoc options --themes and --check-themes to --theme and --c…
GuillaumeGomez Sep 22, 2019
c614cad
Apply review comments
GuillaumeGomez Oct 10, 2019
82a7b32
remove -Z option from rustdoc theme checker tool
GuillaumeGomez Oct 12, 2019
1ebb9ec
improve error messages and documentation
GuillaumeGomez Oct 17, 2019
6fc18a9
Centralize panic macro documentation
czipperz Jun 4, 2019
91aadf0
find_deprecation: deprecation attr may be ill-formed meta.
Centril Nov 13, 2019
e85f40c
add missing 'static lifetime in docs
mulimoen Nov 16, 2019
52d7246
miri panic_unwind: fix hack for SEH platforms
RalfJung Nov 16, 2019
e8ff465
avoid linking errors
RalfJung Nov 16, 2019
bd63c59
Use "field is never read" instead of "field is never used"
Nov 16, 2019
8575743
rustc_plugin: Remove `Registry::register_attribute`
petrochenkov Nov 12, 2019
266f547
ast: Keep `extern` qualifiers in functions more precisely
petrochenkov Nov 9, 2019
00bc449
ast: Keep string literals in ABIs precisely
petrochenkov Nov 9, 2019
b85a3da
parse: Support parsing optional literals
petrochenkov Nov 10, 2019
a699f17
parse: Use string literal parsing in the `asm` macro
petrochenkov Nov 10, 2019
8c7530a
Improve documentation of `Vec::split_off(...)`
mqudsi Oct 23, 2019
a36c3f6
Revise the text of `vec::split_off()` per review in #65739
mqudsi Nov 16, 2019
3407c49
Clarify transmute_copy documentation example
ALSchwalm Nov 16, 2019
11580ce
Address review comments
petrochenkov Nov 16, 2019
28aec1b
Add some more tests
petrochenkov Nov 16, 2019
cfe94b4
Add test for issue 63116
Alexendoo Nov 16, 2019
8195038
Rollup merge of #54733 - GuillaumeGomez:stabilize-rustdoc-theme, r=Dy…
Centril Nov 17, 2019
f188904
Rollup merge of #65739 - mqudsi:vec_split_off_docs, r=dtolnay
Centril Nov 17, 2019
b25e706
Rollup merge of #66271 - petrochenkov:abism, r=Centril
Centril Nov 17, 2019
fd55f5c
Rollup merge of #66344 - petrochenkov:noregattr, r=matthewjasper
Centril Nov 17, 2019
d7b2b87
Rollup merge of #66381 - Centril:66340, r=petrochenkov
Centril Nov 17, 2019
5aa6e46
Rollup merge of #66395 - jplatte:centralize-panic-docs, r=Dylan-DPC
Centril Nov 17, 2019
6268e5b
Rollup merge of #66465 - mulimoen:fix_lifetime_elision_not_shown, r=r…
Centril Nov 17, 2019
99a4b98
Rollup merge of #66466 - RalfJung:seh, r=oli-obk
Centril Nov 17, 2019
c269580
Rollup merge of #66469 - CosineP:fix/field-lint, r=petrochenkov
Centril Nov 17, 2019
d14a893
Rollup merge of #66471 - Alexendoo:test-issue-63116, r=Centril
Centril Nov 17, 2019
9885dd3
Rollup merge of #66477 - ALSchwalm:clarify-transmute-copy, r=Centril
Centril Nov 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve documentation, add checks for themes option arguments, make s…
…ure the themes file names are js compatible
GuillaumeGomez committed Sep 25, 2019
commit b65a3691b9dadbea4fb0f261381541ff9b99d108
5 changes: 4 additions & 1 deletion src/doc/rustdoc/src/command-line-arguments.md
Original file line number Diff line number Diff line change
@@ -368,6 +368,9 @@ you'll need to use this flag as follows:
$ rustdoc src/lib.rs --themes /path/to/your/theme/file.css
```

Note that the theme's name will be the file name without its extension. So if you pass
`/path/to/your/theme/file.css` as theme, then the theme's name will be `file`.

### `check-theme`: check if your themes implement all the required rules

This flag allows you to check if your themes implement the necessary CSS rules. To put it more
@@ -377,5 +380,5 @@ CSS theme.
You can use this flag like this:

```bash
$ rustdoc src/lib.rs --check-theme /path/to/your/theme/file.css
$ rustdoc --check-theme /path/to/your/theme/file.css
```
8 changes: 7 additions & 1 deletion src/librustdoc/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::collections::BTreeMap;
use std::ffi::OsStr;
use std::fmt;
use std::path::PathBuf;

@@ -371,9 +372,14 @@ impl Options {
.emit();
return Err(1);
}
if theme_file.extension() != Some(OsStr::new("css")) {
diag.struct_err(&format!("invalid file: \"{}\": expected CSS file", theme_s))
.emit();
return Err(1);
}
let (success, ret) = theme::test_theme_against(&theme_file, &paths, &diag);
if !success {
diag.struct_warn(&format!("error loading theme file: \"{}\"", theme_s)).emit();
diag.struct_err(&format!("error loading theme file: \"{}\"", theme_s)).emit();
return Err(1);
} else if !ret.is_empty() {
diag.struct_warn(&format!("theme file \"{}\" is missing CSS rules from the \
2 changes: 1 addition & 1 deletion src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
@@ -644,7 +644,7 @@ themePicker.onblur = handleThemeButtonsBlur;
themes.appendChild(but);
}});"#,
themes.iter()
.map(|s| format!("\"{}\"", s))
.map(|s| format!("\"{}\"", s.replace("\\", "\\\\").replace("\"", "\\\"")))
.collect::<Vec<String>>()
.join(","));
write(cx.dst.join(&format!("theme{}.js", cx.shared.resource_suffix)),