feat: add rendering-primitives crate, share non_import_rels across renderers

This commit is contained in:
2026-06-17 13:26:02 +02:00
parent 7487cea0e2
commit 97c7268661
12 changed files with 100 additions and 39 deletions

View File

@@ -0,0 +1,11 @@
use archlens_domain::{Relationship, RelationshipKind};
/// Returns an iterator over all relationships except those with kind `Import`.
pub fn non_import_rels(rels: &[Relationship]) -> impl Iterator<Item = &Relationship> {
rels.iter().filter(|r| r.kind() != RelationshipKind::Import)
}
/// Replaces `::`, `-`, `.`, and space with `_`.
pub fn sanitize_identifier(name: &str) -> String {
name.replace("::", "_").replace(['-', '.', ' '], "_")
}