fixed cross-diagram linking and extend to class/sequence diagrams#242
fixed cross-diagram linking and extend to class/sequence diagrams#242AAmbuj wants to merge 5 commits into
Conversation
AAmbuj
commented
May 22, 2026
- Fix class_serializer to prepend actual source filename to source_files vector, enabling the Sphinx extension to match links by .puml filename
- Extend linker to parse class (CLSD) and sequence (SEQD) FlatBuffers, extracting entities and participants for cross-diagram linking
- Register diagram names as virtual top-level aliases for title-based linking
- Extend clickable_plantuml regex to accept hyphens/dots in element identifiers
- Add linker README with architecture docs and usage instructions
9d8717a to
563c263
Compare
563c263 to
87e45ac
Compare
- Add 'collections' to component_kind in PEG grammar - Add Collections variant to ElementType enum and serializer mapping - Add file_identifier "COMP" to component.fbs schema - Write file identifier in component_serializer for type detection
Prepend the actual source .puml filename to the source_files vector in ClassSerializer::serialize(), enabling the linker and Sphinx extension to correlate class diagrams with their source file.
- Add class_fbs and sequence_fbs dependencies to linker BUILD - Grant linker visibility to class_fbs and sequence_fbs libraries - Detect diagram type via 4-byte file identifier (COMP/CLSD/SEQD) - Add parse_class_diagram: extract entities, FQN IDs, relationships - Add parse_sequence_diagram: extract unique participants recursively - Register diagram names as virtual top-level aliases for title-based linking - Register component FQN (id) as additional index keys - Extract relation targets as linkable elements - Deduplicate relation targets with HashSet
- Add _ALIAS_EXTENDED_RE to accept hyphens/dots in identifiers
(e.g. pkg.Class, my-component)
- Add _ALIAS_QUOTED_RE for names with spaces (wrapped in quotes)
- Refactor _format_alias_part for safe alias formatting
- Strip leading/trailing whitespace before quoting aliases
- Add {_top} window target for correct navigation in embedded SVGs
87e45ac to
d05ee7a
Compare
|
Obsolete due to this PR: #290 |
PlantUML Diagram Linking — Review & Refactor Plan (score_tooling)ContextS-CORE PlantUML diagrams should be clickable: a component referenced in an overview should link to the diagram that details it, a sequence participant to its component, etc. All of that logic lives in the score_tooling module (local checkout /home/jochen/git/tooling), consumed by communication over Bazel. This document reviews the full chain end-to-end and proposes a refactor. The chain as built
Review findings
Refactor planNew UID & role model — no sphinx-needs, no new tagsEverything below is derived from structure the author already writes. Roles from elaboration, not from top-level:
This fixes F6 and inverts the broken "top-level = definition" rule: an overview's top-level leaf boxes are now correctly sources, not targets. Match key from existing identifiers (no new tags):
FTA: dotted aliases ( Worked example (tag-free roles)' overview.puml (Proxy = leaf ⇒ SOURCE)
@startuml
[Gateway] --> [Proxy]
@enduml
' proxy_detail.puml (Proxy has child ⇒ DEFINITION)
@startuml
package Proxy { [RequestHandler] }
@enduml
Phase 1 — Parser: stable source identity + ID manifest (Rust)
{ "source": "score/mw/com/.../proxy_detail.puml",
"defines": [ { "alias": "Proxy", "id": "mw_com.Proxy", "elaborated": true } ],
"references": [ { "alias": "Gateway", "id": "Gateway" } ] }
Phase 2 — Matching moves into the Sphinx extension (
|