def render(self, stream):
    """
    Render the section into *stream*.
    """

    if self.header_type == 'html':
      print('<h{depth} id="{id}">{title}</h{depth}>\n'
        .format(depth = self.depth, id = self.identifier, title = self.title),
        file = stream)
    elif self.header_type == 'markdown':
      print('\n' + ('#' * self.depth), self.title, file = stream)
    else:
      raise ValueError('Invalid header type: %s' % self.header_type)
    print(self.content, file=stream)
def render ( self , stream ) : if self . header_type == 'html' : print ( '<h{depth} id="{id}">{title}</h{depth}>\n' . format ( depth = self . depth , id = self . identifier , title = self . title ) , file = stream ) elif self . header_type == 'markdown' : print ( '\n' + ( '#' * self . depth ) , self . title , file = stream ) else : raise ValueError ( 'Invalid header type: %s' % self . header_type ) print ( self . content , file = stream )
Render the section into *stream*.