#NEWLINE# def to_markup_dict( self , markup , hide_keys = None , show_keys = 'all' ) : #NEWLINE# #INDENT# keys_to_show = [ 'tiid' , 'aliases' , 'biblio' , 'awards' , 'genre' , 'genre_icon' , 'display_genre_plural' , 'countries_str' , 'year' , 'awardedness_score' , 'metrics_raw_sum' , 'title' , 'authors' , 'mendeley_discipline' , 'embed_markup' , 'fulltext_cta' ] #NEWLINE# my_dict = self . to_dict ( keys_to_show ) #NEWLINE# my_dict [ 'markup' ] = markup . make ( my_dict ) #NEWLINE# if ( hide_keys is not None ) : #NEWLINE# #INDENT# for key_to_hide in hide_keys : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# del my_dict [ key_to_hide ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( show_keys != 'all' ) : #NEWLINE# #INDENT# my_small_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( k , v ) in my_dict . iteritems ( ) : #NEWLINE# #INDENT# if ( k in show_keys ) : #NEWLINE# #INDENT# my_small_dict [ k ] = v #NEWLINE# #UNINDENT# #UNINDENT# my_dict = my_small_dict #NEWLINE# #UNINDENT# #UNINDENT# return my_dict