On Wednesday, 29 January 2020 17:11:50 UTC, Komiya Takeshi wrote:
> I think both approach is okay. But, as you experienced, second > approach requires you a knowledge of target document tree. And, it is > not documented well unfortunately. I've usually read source code of > directives, roles, Sphinx itself and other components to know its > structure of doctrees. I feel toughness is needed to do that. So I > recommend first approach to you if possible. > 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 -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/03234941-c7f3-4cd0-9a54-b971290be6f4%40googlegroups.com.
