Skip to content

Commit

Permalink
Merge pull request #61 from t-b/fix__builddoc
Browse files Browse the repository at this point in the history
__builddoc: Create sphinx style links for clickable links
  • Loading branch information
oruebel committed May 16, 2019
2 parents 17e965b + 2b8239d commit 0b327a7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/hdmf/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,13 @@ def __builddoc(func, validator, docstring_fmt, arg_fmt, ret_fmt=None, returns=No
'''Generate a Spinxy docstring'''
def to_str(argtype):
if isinstance(argtype, type):
return argtype.__name__
module = argtype.__module__
name = argtype.__name__

if module.startswith("h5py") or module.startswith("pandas") or module.startswith("builtins"):
return ":py:class:`~{name}`".format(name=name)
else:
return ":py:class:`~{module}.{name}`".format(name=name, module=module)
return argtype

def __sphinx_arg(arg):
Expand Down

0 comments on commit 0b327a7

Please sign in to comment.