def visit_snippet(self, node):
 lang = self.highlightlang
 linenos = (node.rawsource.count('\n') >= (self.highlightlinenothreshold - 1))
 fname = node['filename']
 highlight_args = node.get('highlight_args', {})
 if ('language' in node):
  lang = node['language']
  highlight_args['force'] = True
 if ('linenos' in node):
  linenos = node['linenos']
 def warner(msg):
  self.builder.warn(msg, (self.builder.current_docname, node.line))
 highlighted = self.highlighter.highlight_block(node.rawsource, lang, warn=warner, linenos=linenos, **highlight_args)
 starttag = self.starttag(node, 'div', suffix='', CLASS=('highlight-%s' % lang))
 self.body.append(starttag)
 self.body.append(('<div class="snippet-filename">%s</div>\n' % (fname,)))
 self.body.append(highlighted)
 self.body.append('</div>\n')
 raise nodes.SkipNode

def visit_snippet ( self , node ) : lang = self . highlightlang linenos = ( node . rawsource . count ( '\n' ) >= ( self . highlightlinenothreshold - 1 ) ) fname = node [ 'filename' ] highlight_args = node . get ( 'highlight_args' , { } ) if ( 'language' in node ) : lang = node [ 'language' ] highlight_args [ 'force' ] = True if ( 'linenos' in node ) : linenos = node [ 'linenos' ] def warner ( msg ) : self . builder . warn ( msg , ( self . builder . current_docname , node . line ) ) highlighted = self . highlighter . highlight_block ( node . rawsource , lang , warn = warner , linenos = linenos , ** highlight_args ) starttag = self . starttag ( node , 'div' , suffix = '' , CLASS = ( 'highlight-%s' % lang ) ) self . body . append ( starttag ) self . body . append ( ( '<div class="snippet-filename">%s</div>\n' % ( fname , ) ) ) self . body . append ( highlighted ) self . body . append ( '</div>\n' ) raise nodes . SkipNode
html document generator visit handler .