sphinx-contrib/datatemplates

Bring back datafile type autodetection

janbrohl opened this issue · 4 comments

Usage would be easier if at least some file types can be autdetected.
For this, the datatemplate directive could be refreshed/reused.
One option would be to handle autodetection there and then process specialized directives.

How should we handle options like :header: that dont make sense for all file types?
I would suggest accepting unused options and print a warning.

#41 could make this easier.

Maybe the directive that automatically detects the file format doesn't provide all of the options for all of the formats? So if you want to use an advanced option you use the directive that is specifically for that format?

These are the 2 options and to me, both look valid. Why not do both?
One possibility would be taking

.. datatemplate::

for the accepting approach (compatible) and

.. datatemplate:auto::

for the strict approach with minmal options.