There are two parts to this transform. First is the part that generates the JSON array. This is very much tied to the topic structure... For these topics we have two sections. The first section is always for the overview -- We supply it with metadata to open the proper GUI URL, and then we give the content for the first balloon in the walk-through tour. So that is always the first item in the JSON array. The second section contains the OL that has the procedure steps. For each step in that OL, we create a subsequent array item, with the GUI mapping, and with the LI content. The first pgf in the LI becomes the balloon title, and the rest of the LI content becomes straight HTML for the balloon content.
The second part of the transform produces the balloon content. In principle, this can be anything that can live inside of a LI element. But... Since we don't need it, we don't transform everything. Currently we support ul, ol, p, codeblock, codeph, b, i, and text. I suppose we could do tables (for example), but they don't make sense in a skinny balloon.
We don't support graphics -- I'm not sure how the paths to graphics would work in these walk-throughs, and anyway, images don't make total sense in a walk-through context. The balloon points at the GUI, and that makes the GUI visuals supreme.
We're a small team (started out as a team of one), and so we were really lazy about specialization (as in, we don't do it). We only use TOPIC, and we just "know" what is allowed in a given context. We started using DITA maybe 6 or 7 years ago. I specifically asked this group if only using topic was bad, and if one had to support all of DITA. None other than Michael Priestly said not to worry, and that in fact he was thinking along those lines for LwDITA (if I understood him correctly). We had to get started before LwDITA got solid, so we have what we have. We don't support everything in DITA anyway, and indeed, for our walk-throughs we support even less. But it works.
I'll note that we do other micro-content in popups, and that contains anything that we support overall... Including conrefs, xrefs, and so forth.