code: def convert_table(app, docname, source):
      
      num_tables = 0
      for i,j in enumerate(source):
          table = []
          output = ''
          in_table = False
          for l in j.split('\n'):
              r = l.strip()
              if r.startswith('|'):
                  table.append(r)
                  in_table = True
              else:
                  if in_table is True:
                      converted = _convert_md_table_to_rst(table)
                      if converted is '':
                          print("Failed to convert the markdown table")
                          print(table)
                      else:
                          num_tables += 1
                      output += converted
                      in_table = False
                      table = []
                  output += l + '\n'
          source[i] = output
      if num_tables > 0:
          print('Converted %d tables in %s' % (num_tables, docname))
docs: Find tables in a markdown and then convert them into the rst format