parameters: (self, inner)
docstring: 需要用ul将其包裹
          变为格式如下：
          <div class="cssclass" style="cssstyles">
              <pre style="prestyle">
                  <span></span>
                  <ul>
                      <li>... code area</li>
                      <li>... code area</li>
                      <li class="hll">... code area</li>
                      <li>... code area</li>
                      <li>... code area</li>
                      <li>... code area</li>
                  </ul>
              </pre>
          </div>
docstring_summary: 需要用ul将其包裹
          变为格式如下：
          <div class="cssclass" style="cssstyles">
              <pre style="prestyle">
                  <span></span>
                  <ul>
                      <li>... code area</li>
                      <li>... code area</li>
                      <li class="hll">... code area</li>
                      <li>... code area</li>
                      <li>... code area</li>
                      <li>... code area</li>
                  </ul>
              </pre>
          </div>
docstring_tokens: 需要用ul将其包裹 变为格式如下： <div class = cssclass style = cssstyles > <pre style = prestyle > <span > < / span > <ul > <li > ... code area< / li > <li > ... code area< / li > <li class = hll > ... code area< / li > <li > ... code area< / li > <li > ... code area< / li > <li > ... code area< / li > < / ul > < / pre > < / div >
function: def _wrap_ullinenos(self, inner):
          """
          需要用ul将其包裹
          变为格式如下：
          <div class="cssclass" style="cssstyles">
              <pre style="prestyle">
                  <span></span>
                  <ul>
                      <li>... code area</li>
                      <li>... code area</li>
                      <li class="hll">... code area</li>
                      <li>... code area</li>
                      <li>... code area</li>
                      <li>... code area</li>
                  </ul>
              </pre>
          </div>
          """
          fl = self.linenostart  # 行号起始
          sp = self.linenospecial  # 特殊行间隔数
          st = self.linenostep  # 行号间隔数
          nocls = self.noclasses  # 是否是无class模式
  
          # 高亮行号
          hls = self.hl_line_nums
  
          ulstyles = []
  
          # 处理样式
          if self.ulstyles:
              ulstyles.append(self.ulstyles)
  
          # 如果使用了无class模式，则手动添加公共样式
          if nocls:
              ulstyles.append('padding: 5px 5px 5px 40px !important')
              ulstyles.append('margin: 0')
              ulstyles.append('background: transparent')
  
          # ul头
          ul = '<ul'
          if nocls:
              if self.shownum:
                  ulstyles.append('list-style:decimal')
              else:
                  ulstyles.append('list-style:none')
              ulstyles = '; '.join(ulstyles)
              ul = ul + (ulstyles and (' style="%s"' % ulstyles)) + '>'
          else:
              if self.shownum:
                  # 添加class="numbered"
                  self.ulclass = '%s %s' % (self.ulclass, self.ulnumclass)
              ulstyles = '; '.join(ulstyles)
              ul = ul + (' class="%s"' % self.ulclass) + (ulstyles and (' style="%s"' % ulstyles)) + '>'
  
          yield 0, ul
  
          # 记录行号
          lncount = 0
          for t, line in inner:
              li = '<li'
              if t:
                  lncount += 1
                  liclasses = []
                  listyles = []
                  if nocls:
                      # 添加li基本样式
                      listyles.append('border-left:1px solid #ddd !important')
                      listyles.append('background: transparent')
                      listyles.append('padding: 5px!important')
                      listyles.append('margin:0 !important')
                      listyles.append('line-height:14px')
                      listyles.append('word-break: break-all')
                      listyles.append('word-wrap: break-word')
                  # 高亮
                  if lncount in hls:
                      if not nocls:
                          liclasses.append('hll')
                          highlight_color = self.style.highlight_color
                          if isinstance(self.hl_lines, (dict,)):
                              # 使用用户自定义高亮
                              highlight_color = self.hl_lines[str(lncount)]
                              if highlight_color is not None:
                                  listyles.append('background-color: %s' % (highlight_color, ))
                              else:
                                  listyles.append('background-color: %s' % (highlight_color,))
                      else:
                          highlight_color = self.style.highlight_color
                          if isinstance(self.hl_lines, (dict,)):
                              highlight_color = self.hl_lines[str(lncount)]
                              if highlight_color is not None:
                                  listyles.append('background-color: %s' % (highlight_color, ))
                              else:
                                  listyles.append('background-color: %s' % (highlight_color,))
                          else:
                              # 使用默认高亮
                              listyles.append('background-color: %s' % (highlight_color,))
                  # 间隔行
                  if lncount >= fl and (lncount - fl) % st == 0:
                      # 添加行号
                      if not nocls:
                          liclasses.append('numbered')
                      else:
                          listyles.append('list-style: decimal-leading-zero;')
                  else:
                      # 去除行号
                      if nocls:
                          listyles.append('list-style:none')
  
                  # 特殊行
                  if sp > 0 and lncount % sp == 0:
                      if not nocls:
                          liclasses.append('special')
                      else:
                          listyles.append('color: #999')
                  else:
                      if nocls:
                          listyles.append('color: #222')
  
                  # 不能添加class情况下是否折行需要特殊处理
                  if self.linefeed:
                      if nocls:
                          listyles.append('white-space: pre-wrap')
                  else:
                      if nocls:
                          listyles.append('white-space: pre')
  
                  # 组合
                  liclasses = ' '.join(liclasses)
                  listyles = ';'.join(listyles)
  
                  li = li + (liclasses and (' class="%s"' % liclasses)) + (listyles and (' style="%s"' % listyles)) + '>'
  
                  yield 0, "%s%s</li>" % (li, line)
          # ul尾
          yield 0, '</ul>\n'
function_tokens: def _wrap_ullinenos ( self , inner ) : fl = self . linenostart # 行号起始 sp = self . linenospecial # 特殊行间隔数 st = self . linenostep # 行号间隔数 nocls = self . noclasses # 是否是无class模式 # 高亮行号 hls = self . hl_line_nums ulstyles = [ ] # 处理样式 if self . ulstyles : ulstyles . append ( self . ulstyles ) # 如果使用了无class模式，则手动添加公共样式 if nocls : ulstyles . append ( 'padding: 5px 5px 5px 40px !important' ) ulstyles . append ( 'margin: 0' ) ulstyles . append ( 'background: transparent' ) # ul头 ul = '<ul' if nocls : if self . shownum : ulstyles . append ( 'list-style:decimal' ) else : ulstyles . append ( 'list-style:none' ) ulstyles = '; ' . join ( ulstyles ) ul = ul + ( ulstyles and ( ' style="%s"' % ulstyles ) ) + '>' else : if self . shownum : # 添加class="numbered" self . ulclass = '%s %s' % ( self . ulclass , self . ulnumclass ) ulstyles = '; ' . join ( ulstyles ) ul = ul + ( ' class="%s"' % self . ulclass ) + ( ulstyles and ( ' style="%s"' % ulstyles ) ) + '>' yield 0 , ul # 记录行号 lncount = 0 for t , line in inner : li = '<li' if t : lncount += 1 liclasses = [ ] listyles = [ ] if nocls : # 添加li基本样式 listyles . append ( 'border-left:1px solid #ddd !important' ) listyles . append ( 'background: transparent' ) listyles . append ( 'padding: 5px!important' ) listyles . append ( 'margin:0 !important' ) listyles . append ( 'line-height:14px' ) listyles . append ( 'word-break: break-all' ) listyles . append ( 'word-wrap: break-word' ) # 高亮 if lncount in hls : if not nocls : liclasses . append ( 'hll' ) highlight_color = self . style . highlight_color if isinstance ( self . hl_lines , ( dict , ) ) : # 使用用户自定义高亮 highlight_color = self . hl_lines [ str ( lncount ) ] if highlight_color is not None : listyles . append ( 'background-color: %s' % ( highlight_color , ) ) else : listyles . append ( 'background-color: %s' % ( highlight_color , ) ) else : highlight_color = self . style . highlight_color if isinstance ( self . hl_lines , ( dict , ) ) : highlight_color = self . hl_lines [ str ( lncount ) ] if highlight_color is not None : listyles . append ( 'background-color: %s' % ( highlight_color , ) ) else : listyles . append ( 'background-color: %s' % ( highlight_color , ) ) else : # 使用默认高亮 listyles . append ( 'background-color: %s' % ( highlight_color , ) ) # 间隔行 if lncount >= fl and ( lncount - fl ) % st == 0 : # 添加行号 if not nocls : liclasses . append ( 'numbered' ) else : listyles . append ( 'list-style: decimal-leading-zero;' ) else : # 去除行号 if nocls : listyles . append ( 'list-style:none' ) # 特殊行 if sp > 0 and lncount % sp == 0 : if not nocls : liclasses . append ( 'special' ) else : listyles . append ( 'color: #999' ) else : if nocls : listyles . append ( 'color: #222' ) # 不能添加class情况下是否折行需要特殊处理 if self . linefeed : if nocls : listyles . append ( 'white-space: pre-wrap' ) else : if nocls : listyles . append ( 'white-space: pre' ) # 组合 liclasses = ' ' . join ( liclasses ) listyles = ';' . join ( listyles ) li = li + ( liclasses and ( ' class="%s"' % liclasses ) ) + ( listyles and ( ' style="%s"' % listyles ) ) + '>' yield 0 , "%s%s</li>" % ( li , line ) # ul尾 yield 0 , '</ul>\n'