<s> """<STR_LIT>""" <EOL> from docutils import core , io <EOL> def html_parts ( input_string , source_path = None , destination_path = None , <EOL> input_encoding = '<STR_LIT>' , doctitle = True , <EOL> initial_header_level = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> overrides = { '<STR_LIT>' : input_encoding , <EOL> '<STR_LIT>' : doctitle , <EOL> '<STR_LIT>' : initial_header_level } <EOL> parts = core . publish_parts ( <EOL> source = input_string , source_path = source_path , <EOL> destination_path = destination_path , <EOL> writer_name = '<STR_LIT:html>' , settings_overrides = overrides ) <EOL> return parts <EOL> def html_body ( input_string , source_path = None , destination_path = None , <EOL> input_encoding = '<STR_LIT>' , output_encoding = '<STR_LIT>' , <EOL> doctitle = True , initial_header_level = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> parts = html_parts ( <EOL> input_string = input_string , source_path = source_path , <EOL> destination_path = destination_path , <EOL> input_encoding = input_encoding , doctitle = doctitle , <EOL> initial_header_level = initial_header_level ) <EOL> fragment = parts [ '<STR_LIT>' ] <EOL> if output_encoding != '<STR_LIT>' : <EOL> fragment = fragment . encode ( output_encoding ) <EOL> return fragment <EOL> def internals ( input_string , source_path = None , destination_path = None , <EOL> input_encoding = '<STR_LIT>' , settings_overrides = None ) : <EOL> """<STR_LIT>""" <EOL> if settings_overrides : <EOL> overrides = settings_overrides . copy ( ) <EOL> else : <EOL> overrides = { } <EOL> overrides [ '<STR_LIT>' ] = input_encoding <EOL> output , pub = core . publish_programmatically ( <EOL> source_class = io . StringInput , source = input_string , <EOL> source_path = source_path , <EOL> destination_class = io . NullOutput , destination = None , <EOL> destination_path = destination_path , <EOL> reader = None , reader_name = '<STR_LIT>' , <EOL> parser = None , parser_name = '<STR_LIT>' , <EOL> writer = None , writer_name = '<STR_LIT:null>' , <EOL> settings = None , settings_spec = None , settings_overrides = overrides , <EOL> config_section = None , enable_exit_status = None ) <EOL> return pub . writer . document , pub </s>
