def generate(self, lamark_ast): self._init_plugins() md_ast = lmast.map_postorder(lamark_ast, self.gen_dispatch) md_string = "" for md_node in md_ast.doc: md_string += md_node.string self._tear_down_plugins() return md_string
def parse(self, ast): """Parses the tags of the nodes in a LaMark AST.""" parsed_ast = lmast.map_postorder(ast, self.tag_parse_dispatch) return parsed_ast