There is also syntax for adding metadata to any markdown element used already in many implementations.
Request for official inclusion in Commonmark is here: Consistent attribute syntax - #22 by mofosyne - Extensions - CommonMark Discussion
I might post request to recognize this markdown extension here on Obsidian.
Another inspiration from RemNote: Display vertical context in long scrollable document (RemNote-like auto-folding mode)