Noah Watkins <[email protected]> writes: > Hi, > > I'm working on a custom directive, and have made a lot of progress, but I'm > hitting a bit of a wall. My directive is fundamentally simple: I'm > rendering a source json file to table format. I've used other extensions as > a reference and have gotten this to work well. > > The problem I'm trying to solve now is resolving references (e.g. to > section labels, etc...) that are specified in the json source. I don't need > to worry about any internal references within the source. > > Unfortunately, I haven't been able to find any sample code that does this, > to use a model. The todo extension comes close: it seems to resolve > references within the todo items, but the extension itself is built quite > differently, and the resolution occurs after 'doctree-resolved' fires and > uses custom nodes etc... > > Any pointers or suggestions would be useful. Thanks.
I've stopped trying to write extensions that do all of the complicated work with the internal data structures, and just have them build RST in memory and then parse that. You can see an example of one such in https://github.com/sphinx-contrib/datatemplates That extension might even be useful to you directly, if you feed it the JSON file and a template that renders a list-table directive. Doug -- 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 post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sphinx-users. For more options, visit https://groups.google.com/d/optout.
