def patch_doc_config(config_file):
 nospell = {u'tex_inline_wrap': [u'<nospell>\\(', u'</nospell>\\)'], u'tex_block_wrap': [u'<nospell>\\[', u'</nospell>\\]']}
 with open(config_file, u'rb') as f:
  config = yaml_load(f)
 index = 0
 for extension in config.get(u'markdown_extensions', []):
  if (isinstance(extension, (str if PY3 else unicode)) and (extension == u'pymdownx.arithmatex')):
   config[u'markdown_extensions'][index] = {u'pymdownx.arithmatex': nospell}
   break
  elif (isinstance(extension, dict) and (u'pymdownx.arithmatex' in extension)):
   extension[u'pymdownx.arithmatex'] = nospell
   break
  index += 1
 with codecs.open(MKDOCS_SPELL, u'w', encoding=u'utf-8') as f:
  yaml_dump(config, f, width=None, indent=4, allow_unicode=True, default_flow_style=False)
 return MKDOCS_SPELL

def patch_doc_config ( config_file ) : nospell = { u'tex_inline_wrap' : [ u'<nospell>\\(' , u'</nospell>\\)' ] , u'tex_block_wrap' : [ u'<nospell>\\[' , u'</nospell>\\]' ] } with open ( config_file , u'rb' ) as f : config = yaml_load ( f ) index = 0 for extension in config . get ( u'markdown_extensions' , [ ] ) : if ( isinstance ( extension , ( str if PY3 else unicode ) ) and ( extension == u'pymdownx.arithmatex' ) ) : config [ u'markdown_extensions' ] [ index ] = { u'pymdownx.arithmatex' : nospell } break elif ( isinstance ( extension , dict ) and ( u'pymdownx.arithmatex' in extension ) ) : extension [ u'pymdownx.arithmatex' ] = nospell break index += 1 with codecs . open ( MKDOCS_SPELL , u'w' , encoding = u'utf-8' ) as f : yaml_dump ( config , f , width = None , indent = 4 , allow_unicode = True , default_flow_style = False ) return MKDOCS_SPELL
patch the config file to wrap arithmatex with a tag aspell can ignore .