Rollup merge of #48511 - GuillaumeGomez:rustdoc-resource-suffix, r=QuietMisdreavus

Add resource-suffix option for rustdoc

Alternative version of #48442.

cc @onur

r? @QuietMisdreavus
This commit is contained in:
Alex Crichton
2018-03-06 20:01:05 -06:00
committed by GitHub
4 changed files with 64 additions and 27 deletions

View File

@@ -261,6 +261,13 @@ pub fn opts() -> Vec<RustcOptGroup> {
"check if given theme is valid",
"FILES")
}),
unstable("resource-suffix", |o| {
o.optopt("",
"resource-suffix",
"suffix to add to CSS and JavaScript files, e.g. \"main.css\" will become \
\"main-suffix.css\"",
"PATH")
}),
]
}
@@ -417,6 +424,7 @@ pub fn main_args(args: &[String]) -> isize {
let display_warnings = matches.opt_present("display-warnings");
let linker = matches.opt_str("linker").map(PathBuf::from);
let sort_modules_alphabetically = !matches.opt_present("sort-modules-by-appearance");
let resource_suffix = matches.opt_str("resource-suffix");
match (should_test, markdown_input) {
(true, true) => {
@@ -442,6 +450,7 @@ pub fn main_args(args: &[String]) -> isize {
Some("html") | None => {
html::render::run(krate, &external_html, playground_url,
output.unwrap_or(PathBuf::from("doc")),
resource_suffix.unwrap_or(String::new()),
passes.into_iter().collect(),
css_file_extension,
renderinfo,