def add_doc_link(app, pagename, templatename, context, doctree):
 if ((not app.config.github_user) and app.config.github_project):
  return
 source_suffix = app.config.source_suffix
 source_suffix = (source_suffix if isinstance(source_suffix, basestring) else source_suffix[0])
 context['github_link'] = (lambda mode='edit': make_github_link(app, ('doc/%s%s' % (pagename, source_suffix)), mode=mode))

def add_doc_link ( app , pagename , templatename , context , doctree ) : if ( ( not app . config . github_user ) and app . config . github_project ) : return source_suffix = app . config . source_suffix source_suffix = ( source_suffix if isinstance ( source_suffix , basestring ) else source_suffix [ 0 ] ) context [ 'github_link' ] = ( lambda mode = 'edit' : make_github_link ( app , ( 'doc/%s%s' % ( pagename , source_suffix ) ) , mode = mode ) )
add github_link function linking to the current page on github .