def mark_as_titlepage(container, name, move_to_start=True):
 ver = container.opf_version_parsed
 if move_to_start:
  for (item, q, linear) in container.spine_iter:
   if (name == q):
    break
  if (not linear):
   item.set(u'linear', u'yes')
  if (item.getparent().index(item) > 0):
   container.insert_into_xml(item.getparent(), item, 0)
 if (ver.major < 3):
  for ref in container.opf_xpath(u'//opf:guide/opf:reference[@type="cover"]'):
   ref.getparent().remove(ref)
  for guide in get_guides(container):
   container.insert_into_xml(guide, guide.makeelement(OPF(u'reference'), type=u'cover', href=container.name_to_href(name, container.opf_name)))
 else:
  container.apply_unique_properties(name, u'calibre:title-page')
 container.dirty(container.opf_name)

def mark_as_titlepage ( container , name , move_to_start = True ) : ver = container . opf_version_parsed if move_to_start : for ( item , q , linear ) in container . spine_iter : if ( name == q ) : break if ( not linear ) : item . set ( u'linear' , u'yes' ) if ( item . getparent ( ) . index ( item ) > 0 ) : container . insert_into_xml ( item . getparent ( ) , item , 0 ) if ( ver . major < 3 ) : for ref in container . opf_xpath ( u'//opf:guide/opf:reference[@type="cover"]' ) : ref . getparent ( ) . remove ( ref ) for guide in get_guides ( container ) : container . insert_into_xml ( guide , guide . makeelement ( OPF ( u'reference' ) , type = u'cover' , href = container . name_to_href ( name , container . opf_name ) ) ) else : container . apply_unique_properties ( name , u'calibre:title-page' ) container . dirty ( container . opf_name )
mark the specified html file as the titlepage of the epub .