def METHOD_NAME(text, level, state):
    # we will use this method to replace tokenize_heading
    tid = 'toc_' + str(len(state['toc_headings']) + 1)
    state['toc_headings'].append((tid, text, level))
    return {'type': 'theading', 'text': text, 'params': (level, tid)}