def as_json(document): "JSON representation of the markdown document" return json.loads(pypandoc.convert_text(document, 'json', format='markdown'))