Thanks for the advice. In the interim before I read your reply
I made some progress with the option-2 (create docutils nodes)
approach, so I might continue with that for the moment, at
least for this specific extension. But I'll bear in mind that
just-write-rST-source is probably the way to go in future.
It occurred to me that in theory Sphinx could have a 'lint'
builder which just syntax-checked the nodes to ensure they
had all the required properties/children/etc. I suspect it
would be a lot of work to try to nail down exactly what the
things it needed to check would be though...
thanks
-- PMM