Add resource-suffix option for rustdoc

This commit is contained in:
Guillaume Gomez
2018-02-24 19:14:36 +01:00
parent 3eeb5a665e
commit 831009f035
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,