def mathjax_for_markdown(pelicanobj, mathjax_script, mathjax_settings):
 config = {}
 config['mathjax_script'] = mathjax_script
 config['math_tag_class'] = 'math'
 config['auto_insert'] = mathjax_settings['auto_insert']
 try:
  if isinstance(pelicanobj.settings.get('MD_EXTENSIONS'), list):
   pelicanobj.settings['MD_EXTENSIONS'].append(PelicanMathJaxExtension(config))
  else:
   pelicanobj.settings['MARKDOWN'].setdefault('extensions', []).append(PelicanMathJaxExtension(config))
 except:
  sys.excepthook(*sys.exc_info())
  sys.stderr.write('\nError - the pelican mathjax markdown extension failed to configure. MathJax is non-functional.\n')
  sys.stderr.flush()

def mathjax_for_markdown ( pelicanobj , mathjax_script , mathjax_settings ) : config = { } config [ 'mathjax_script' ] = mathjax_script config [ 'math_tag_class' ] = 'math' config [ 'auto_insert' ] = mathjax_settings [ 'auto_insert' ] try : if isinstance ( pelicanobj . settings . get ( 'MD_EXTENSIONS' ) , list ) : pelicanobj . settings [ 'MD_EXTENSIONS' ] . append ( PelicanMathJaxExtension ( config ) ) else : pelicanobj . settings [ 'MARKDOWN' ] . setdefault ( 'extensions' , [ ] ) . append ( PelicanMathJaxExtension ( config ) ) except : sys . excepthook ( * sys . exc_info ( ) ) sys . stderr . write ( '\nError - the pelican mathjax markdown extension failed to configure. MathJax is non-functional.\n' ) sys . stderr . flush ( )
instantiates a customized markdown extension for handling mathjax related content .