aboutsummaryrefslogtreecommitdiff
path: root/.run/src/bin/deploy-api-docs.rs
diff options
context:
space:
mode:
Diffstat (limited to '.run/src/bin/deploy-api-docs.rs')
-rw-r--r--.run/src/bin/deploy-api-docs.rs23
1 files changed, 18 insertions, 5 deletions
diff --git a/.run/src/bin/deploy-api-docs.rs b/.run/src/bin/deploy-api-docs.rs
index 7aa093c..961eb04 100644
--- a/.run/src/bin/deploy-api-docs.rs
+++ b/.run/src/bin/deploy-api-docs.rs
@@ -1,10 +1,15 @@
use std::path::Path;
+use arg_picker::{Picker, macros::arg};
use tools::{println_cargo_style, run_cmd};
const OUTPUT_DIR: &str = "docs/api-docs";
fn main() {
+ let using_docsrs = Picker::from_args()
+ .pick_or_default(&arg![docsrs: bool])
+ .unwrap();
+
let repo_root = find_git_repo().expect("Failed to find git repository root");
// Read features from [package.metadata.docs.rs]
@@ -20,11 +25,19 @@ fn main() {
std::fs::create_dir_all(&output_path).expect("Failed to create output directory");
// Build cargo doc command
- let cmd = format!(
- "cargo doc --no-deps --features \"{}\" -p mingling --target-dir \"{}\" --color always",
- features_arg,
- output_path.join("target").to_string_lossy()
- );
+ let cmd = if using_docsrs {
+ format!(
+ "cargo +nightly rustdoc --features \"{}\" -p mingling --target-dir \"{}\" --color always -- --cfg docsrs",
+ features_arg,
+ output_path.join("target").to_string_lossy()
+ )
+ } else {
+ format!(
+ "cargo doc --no-deps --features \"{}\" -p mingling --target-dir \"{}\" --color always",
+ features_arg,
+ output_path.join("target").to_string_lossy()
+ )
+ };
println_cargo_style!("Features: {}", features_arg);
println_cargo_style!("Output: {}", output_path.display());