##// END OF EJS Templates
Update sphinxify usage
martinRenou -
Show More
@@ -90,12 +90,17 b' sphinxify: Optional[Callable]'
90 90 try:
91 91 import docrepr.sphinxify as sphx
92 92
93 def sphinxify(doc):
93 def sphinxify(oinfo):
94 wrapped_docstring = sphx.wrap_main_docstring(oinfo)
95
96 def sphinxify_docstring(docstring):
94 97 with TemporaryDirectory() as dirname:
95 98 return {
96 'text/html': sphx.sphinxify(doc, dirname),
97 'text/plain': doc
99 'text/html': sphx.sphinxify(wrapped_docstring, dirname),
100 'text/plain': docstring
98 101 }
102
103 return sphinxify_docstring
99 104 except ImportError:
100 105 sphinxify = None
101 106
@@ -1621,7 +1626,7 b' class InteractiveShell(SingletonConfigurable):'
1621 1626 This function is meant to be called by pdef, pdoc & friends.
1622 1627 """
1623 1628 info = self._object_find(oname, namespaces)
1624 docformat = sphinxify if self.sphinxify_docstring else None
1629 docformat = sphinxify(self.object_inspect(oname)) if self.sphinxify_docstring else None
1625 1630 if info.found:
1626 1631 pmethod = getattr(self.inspector, meth)
1627 1632 # TODO: only apply format_screen to the plain/text repr of the mime
@@ -1668,7 +1673,7 b' class InteractiveShell(SingletonConfigurable):'
1668 1673 with self.builtin_trap:
1669 1674 info = self._object_find(oname)
1670 1675 if info.found:
1671 docformat = sphinxify if self.sphinxify_docstring else None
1676 docformat = sphinxify(self.object_inspect(oname)) if self.sphinxify_docstring else None
1672 1677 return self.inspector._get_info(
1673 1678 info.obj,
1674 1679 oname,
General Comments 0
You need to be logged in to leave comments. Login now