Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# encoding: utf-8 

2from . import * 

3 

4def badge(text='', level='default'): 

5 """ *Generate a badge - TBS style* 

6 

7 **Key Arguments** 

8 

9 - ``text`` -- the text content 

10 - ``level`` -- the level colour of the badge [ "default" | "success" | "warning" | "important" | "info" | "inverse" ] 

11  

12 

13 **Return** 

14 

15 - ``badge`` -- the badge """ 

16 

17 

18 if level == 'default': 

19 level = '' 

20 else: 

21 level = 'badge-%(level)s' % locals() 

22 badge = """ 

23 <span class="badge %(level)s" id=" "> 

24 %(text)s 

25 </span>""" % locals() 

26 return badge