sphinx-contrib/datatemplates

Allow using directive body content as template

janbrohl opened this issue · 4 comments

Currently the room "inside" the directive is unused.
Would it make sense to either make

.. datatemplate::
    :source: some-file.json
    
    {{ data.key }}

or

.. datatemplate::
    :template: great-template
    
    {"a":1,"b":2}

work?

I like that.

Actually, depening on which option is present, the body could be treaded as the missing part but that would be confusing, I guess.
Thinking over it again, putting the template string in the body seems more natural for me.

This could complement #34

Closed via #36