Skip to content

Commit bba274f

Browse files
committed
add option to include private items in library docs
1 parent c8e6a9e commit bba274f

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

config.toml.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ changelog-seen = 2
233233
# and generated in already-minified form from the beginning.
234234
#docs-minification = true
235235

236+
# Flag to specify whether private items should be included in the library docs.
237+
#library-docs-private-items = false
238+
236239
# Indicate whether the compiler should be documented in addition to the standard
237240
# library and facade crates.
238241
#compiler-docs = false

src/bootstrap/config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ pub struct Config {
6565
pub verbose: usize,
6666
pub submodules: Option<bool>,
6767
pub compiler_docs: bool,
68+
pub library_docs_private_items: bool,
6869
pub docs_minification: bool,
6970
pub docs: bool,
7071
pub locked_deps: bool,
@@ -606,6 +607,7 @@ define_config! {
606607
rustfmt: Option<PathBuf> = "rustfmt",
607608
docs: Option<bool> = "docs",
608609
compiler_docs: Option<bool> = "compiler-docs",
610+
library_docs_private_items: Option<bool> = "library-docs-private-items",
609611
docs_minification: Option<bool> = "docs-minification",
610612
submodules: Option<bool> = "submodules",
611613
gdb: Option<String> = "gdb",
@@ -1015,6 +1017,7 @@ impl Config {
10151017
config.submodules = build.submodules;
10161018
set(&mut config.low_priority, build.low_priority);
10171019
set(&mut config.compiler_docs, build.compiler_docs);
1020+
set(&mut config.library_docs_private_items, build.library_docs_private_items);
10181021
set(&mut config.docs_minification, build.docs_minification);
10191022
set(&mut config.docs, build.docs);
10201023
set(&mut config.locked_deps, build.locked_deps);

src/bootstrap/doc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,9 @@ fn doc_std(
597597
.arg("--resource-suffix")
598598
.arg(&builder.version)
599599
.args(extra_args);
600+
if builder.config.library_docs_private_items {
601+
cargo.arg("--document-private-items");
602+
}
600603
builder.run(&mut cargo.into());
601604
};
602605

0 commit comments

Comments
 (0)