Closed fiddlerwoaroof closed 7 years ago
To be clear, do you actually need full support for dynamic tags, or would a specific solution to the problem of nesting headings be acceptable?
That would work too for my current purposes, as long as the heading level is determined at run time and not before.
This is in Spinneret now. There is support for dynamic tags (using the :tag
pseudo-tag) and a specific pseudo-tag for this particular use case (:h*
). The README has the details.
Great, thanks!
I'd like to be able to leave a tag unfilled at compile time and then generate it at run time. For example, I'd like to be able to automatically create the appropriate h1-h6 tag based on the value of a dynamic variable, something like:
should generate something like
I can do this right now by doing something like
But that seems a bit inelegant: (a) it seems to be doing stuff at a lower-level than the rest of the surrounding code and (b) it doesn't interact well with the pretty printer.