def rst_add_mathjax(content):
 (_, ext) = os.path.splitext(os.path.basename(content.source_path))
 if (ext != '.rst'):
  return
 if ('class="math"' in content._content):
  content._content += ("<script type='text/javascript'>%s</script>" % rst_add_mathjax.mathjax_script)

def rst_add_mathjax ( content ) : ( _ , ext ) = os . path . splitext ( os . path . basename ( content . source_path ) ) if ( ext != '.rst' ) : return if ( 'class="math"' in content . _content ) : content . _content += ( "<script type='text/javascript'>%s</script>" % rst_add_mathjax . mathjax_script )
adds mathjax script for restructuredtext .