#NEWLINE# def visit_title( self , node ) : #NEWLINE# #INDENT# 'Only 6 section levels are supported by HTML.' #NEWLINE# check_id = 0 #NEWLINE# close_tag = '</p>\n' #NEWLINE# if isinstance ( node . parent , nodes . topic ) : #NEWLINE# #INDENT# self . body . append ( self . starttag ( node , 'p' , '' , CLASS = 'topic-title first' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( node . parent , nodes . sidebar ) : #NEWLINE# #INDENT# self . body . append ( self . starttag ( node , 'p' , '' , CLASS = 'sidebar-title' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( node . parent , nodes . Admonition ) : #NEWLINE# #INDENT# self . body . append ( self . starttag ( node , 'p' , '' , CLASS = 'admonition-title' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( node . parent , nodes . table ) : #NEWLINE# #INDENT# self . body . append ( self . starttag ( node , 'caption' , '' ) ) #NEWLINE# close_tag = '</caption>\n' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( node . parent , nodes . document ) : #NEWLINE# #INDENT# self . body . append ( self . starttag ( node , 'h1' , '' , CLASS = 'title' ) ) #NEWLINE# close_tag = '</h1>\n' #NEWLINE# self . in_document_title = len ( self . body ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert isinstance ( node . parent , nodes . section ) #NEWLINE# h_level = ( ( self . section_level + self . initial_header_level ) - 1 ) #NEWLINE# atts = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( ( len ( node . parent ) >= 2 ) and isinstance ( node . parent [ 1 ] , nodes . subtitle ) ) : #NEWLINE# #INDENT# atts [ 'CLASS' ] = 'with-subtitle' #NEWLINE# #UNINDENT# self . body . append ( self . starttag ( node , ( 'h%s' % h_level ) , '' , ** atts ) ) #NEWLINE# atts = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if node . hasattr ( 'refid' ) : #NEWLINE# #INDENT# atts [ 'class' ] = 'toc-backref' #NEWLINE# atts [ 'href' ] = ( '#' + node [ 'refid' ] ) #NEWLINE# #UNINDENT# if atts : #NEWLINE# #INDENT# self . body . append ( self . starttag ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , 'a' , '' , ** atts ) ) #NEWLINE# close_tag = ( '</a></h%s>\n' % h_level ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# close_tag = ( '</h%s>\n' % h_level ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# self . context . append ( close_tag )