diff --git a/rivet-cli/src/main.rs b/rivet-cli/src/main.rs index 9b0a8331..33cc5951 100644 --- a/rivet-cli/src/main.rs +++ b/rivet-cli/src/main.rs @@ -7352,6 +7352,7 @@ fn cmd_export( homepage, version_label, versions_json, + sexpr_filter, ); } @@ -7979,6 +7980,7 @@ fn cmd_export_html( _homepage: Option<&str>, _version_label: Option<&str>, _versions_json: Option<&str>, + sexpr_filter: Option<&str>, ) -> Result { use crate::render::styles; use crate::serve::components::ViewParams; @@ -8079,7 +8081,14 @@ fn cmd_export_html( .filter(|d| d.severity == rivet_core::schema::Severity::Error) .count(); - let wrap_page = |title: &str, content: &str| -> String { + let wrap_page = |title: &str, content: &str, rel_path: &str| -> String { + // REQ-088: depth-adjusted prefix so per-page asset and nav hrefs + // work for pages at any nesting (root, depth-1, depth-2, …). + // `rel_path` is the page's path relative to `out_dir`, e.g. + // "index.html" (depth 0) or "artifacts/foo.html" (depth 1) or + // "help/schema/foo.html" (depth 2). + let depth = rel_path.matches('/').count(); + let prefix: String = "../".repeat(depth); let version = env!("CARGO_PKG_VERSION"); let project_name = &state.context.project_name; let error_badge = if error_count > 0 { @@ -8111,7 +8120,7 @@ fn cmd_export_html( .sum(); let stpa_nav = if stpa_count > 0 { format!( - "
  • STPA \ + "
  • STPA \ {stpa_count}
  • " ) } else { @@ -8128,7 +8137,7 @@ fn cmd_export_html( } else { String::new() }; - format!("
  • EU AI Act{badge}
  • ") + format!("
  • EU AI Act{badge}
  • ") } else { String::new() }; @@ -8139,8 +8148,8 @@ fn cmd_export_html( {title} — {project_name} — Rivet - - + +