com-lihaoyi / scalatags

ScalaTags is a small XML/HTML construction library for Scala.
https://com-lihaoyi.github.io/scalatags/
MIT License
757 stars 117 forks source link

Allow traversal of constructed Tag tree #206

Closed scf37 closed 4 years ago

scf37 commented 4 years ago

Use case: render subtree of constructed tag tree

Problem: Tag frags might contain instances of Util$SeqNode and Text$Cap$SeqFrag which do not expose nested sequence

Proposal: make them case classes and non-path-dependent types to simplify matching

lihaoyi commented 4 years ago

Scalatags' current API is intended to be write-only; the data structures involved aren't designed to be read or manipulated in any convenient way. It should be possible to write a Scalatags backend that renders to a convenient XML AST of your choice, similar to how we currently can render to dom.Element nodes, but defining such a convenient XML AST would be beyond the scope of this ticket.