I’m developing a docstring viewer and so I would like to properly convert any docstring to good looking html.
Docstrings in most of the standard libraries are not in reST, but that’s not the case for scientific libraries, which have adopted for the most part the numpydoc standard.
So I would like to reliably detect whether a docstring is in reST or not, in order to pass it to different renders.
Since ReST is a format that tries to look as much as possible like readable plain text, there is no reliable way to detect if any piece of text is using ReST, let alone something as small as a docstring.
I’d say you should just try and render it as ReST and give the end-user the option to switch that off again.