Skip to content

Commit

Permalink
Fix links to blueprint components/archetype that don't show up in our…
Browse files Browse the repository at this point in the history
… reference yet (#8430)
  • Loading branch information
Wumpf authored Dec 12, 2024
1 parent bee0f81 commit 931561e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 9 additions & 2 deletions crates/build/re_types_builder/src/docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,13 @@ mod doclink_translation {
}
}
Target::WebDocsMarkdown => {
let kind_and_type = format!("{kind}.{type_name}");

// TODO(andreas): We don't show blueprint components & archetypes in the web docs yet.
if scope == "blueprint" && (kind == "components" || kind == "archetypes") {
return Ok(kind_and_type);
}

// For instance, https://rerun.io/docs/reference/types/views/spatial2d_view
// TODO(emilk): relative links would be nicer for the local markdown files
let type_name_snake_case = re_case::to_snake_case(type_name);
Expand All @@ -430,9 +437,9 @@ mod doclink_translation {
"https://rerun.io/docs/reference/types/{kind}/{type_name_snake_case}{query}"
);
if let Some(field_or_enum_name) = field_or_enum_name {
format!("[`{kind}.{type_name}#{field_or_enum_name}`]({url})")
format!("[`{kind_and_type}#{field_or_enum_name}`]({url})")
} else {
format!("[`{kind}.{type_name}`]({url})")
format!("[`{kind_and_type}`]({url})")
}
}
})
Expand Down
8 changes: 4 additions & 4 deletions crates/store/re_types/src/reflection/mod.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 931561e

Please sign in to comment.