def source_read(app, docname, source):
 if (docname != 'extensions/plugins-toolkit'):
  return
 source_ = ''
 for (name, thing) in inspect.getmembers(toolkit):
  custom_docstring = toolkit.docstring_overrides.get(name)
  if inspect.isfunction(thing):
   source_ += format_function(name, thing, docstring=custom_docstring)
  elif inspect.ismethod(thing):
   source_ += format_function(name, thing, docstring=custom_docstring)
  elif inspect.isclass(thing):
   source_ += format_class(name, thing, docstring=custom_docstring)
  elif isinstance(thing, types.ObjectType):
   source_ += format_object(name, thing, docstring=custom_docstring)
  else:
   assert False, "Someone added {name}:{thing} to the plugins toolkit and this Sphinx extension doesn't know how to document that yet. If you're that someone, you need to add a new format_*() function for it here or the docs won't build.".format(name=name, thing=thing)
 source[0] += source_

def source_read ( app , docname , source ) : if ( docname != 'extensions/plugins-toolkit' ) : return source_ = '' for ( name , thing ) in inspect . getmembers ( toolkit ) : custom_docstring = toolkit . docstring_overrides . get ( name ) if inspect . isfunction ( thing ) : source_ += format_function ( name , thing , docstring = custom_docstring ) elif inspect . ismethod ( thing ) : source_ += format_function ( name , thing , docstring = custom_docstring ) elif inspect . isclass ( thing ) : source_ += format_class ( name , thing , docstring = custom_docstring ) elif isinstance ( thing , types . ObjectType ) : source_ += format_object ( name , thing , docstring = custom_docstring ) else : assert False , "Someone added {name}:{thing} to the plugins toolkit and this Sphinx extension doesn't know how to document that yet. If you're that someone, you need to add a new format_*() function for it here or the docs won't build." . format ( name = name , thing = thing ) source [ 0 ] += source_
transform the contents of plugins-toolkit .