<s> """<STR_LIT>""" <EOL> __author__ = """<STR_LIT>""" <EOL> IS_MAIN = True if __name__ == '<STR_LIT:__main__>' else False <EOL> if IS_MAIN : <EOL> from os import getcwd <EOL> from os import sys <EOL> sys . path . append ( getcwd ( ) ) <EOL> from collections import namedtuple <EOL> from MOAL . helpers . display import Section <EOL> Heading = namedtuple ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> Tag = namedtuple ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def transpile_md_to_python ( markdown ) : <EOL> """<STR_LIT>""" <EOL> for line in markdown . split ( '<STR_LIT:\n>' ) : <EOL> line = line . lstrip ( ) <EOL> if line . startswith ( '<STR_LIT>' ) : <EOL> yield Heading ( <NUM_LIT:1> , line , '<STR_LIT>' ) <EOL> elif line . startswith ( '<STR_LIT>' ) : <EOL> yield Heading ( <NUM_LIT:2> , line , '<STR_LIT>' ) <EOL> elif line . startswith ( '<STR_LIT>' ) : <EOL> yield Heading ( <NUM_LIT:3> , line , '<STR_LIT>' ) <EOL> elif line . startswith ( '<STR_LIT>' ) : <EOL> yield Heading ( <NUM_LIT:4> , line , '<STR_LIT>' ) <EOL> elif line . startswith ( '<STR_LIT>' ) : <EOL> yield Heading ( <NUM_LIT:5> , line , '<STR_LIT>' ) <EOL> elif line . startswith ( '<STR_LIT>' ) : <EOL> yield Heading ( <NUM_LIT:6> , line , '<STR_LIT>' ) <EOL> elif line . startswith ( '<STR_LIT:*>' ) and not line . endswith ( '<STR_LIT>' ) : <EOL> yield Tag ( '<STR_LIT>' , line , '<STR_LIT>' ) <EOL> elif line . startswith ( '<STR_LIT>' ) and line . endswith ( '<STR_LIT>' ) : <EOL> yield Tag ( '<STR_LIT>' , line , '<STR_LIT>' ) <EOL> elif line . startswith ( '<STR_LIT:[>' ) and line . endswith ( '<STR_LIT:)>' ) : <EOL> yield Tag ( '<STR_LIT>' , line , '<STR_LIT:a>' ) <EOL> if IS_MAIN : <EOL> with Section ( '<STR_LIT>' ) : <EOL> markdown = """<STR_LIT>""" <EOL> transd = transpile_md_to_python ( markdown ) <EOL> print ( list ( transd ) ) </s>
