def ghcommit_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
 app = inliner.document.settings.env.app
 try:
  base = app.config.github_project_url
  if (not base):
   raise AttributeError
  if (not base.endswith('/')):
   base += '/'
 except AttributeError as err:
  raise ValueError(('github_project_url configuration value is not set (%s)' % str(err)))
 ref = (base + text)
 node = nodes.reference(rawtext, text[:6], refuri=ref, **options)
 return ([node], [])

def ghcommit_role ( name , rawtext , text , lineno , inliner , options = { } , content = [ ] ) : app = inliner . document . settings . env . app try : base = app . config . github_project_url if ( not base ) : raise AttributeError if ( not base . endswith ( '/' ) ) : base += '/' except AttributeError as err : raise ValueError ( ( 'github_project_url configuration value is not set (%s)' % str ( err ) ) ) ref = ( base + text ) node = nodes . reference ( rawtext , text [ : 6 ] , refuri = ref , ** options ) return ( [ node ] , [ ] )
link to a github commit .