QScintilla/MarkupProviders/HtmlProvider.py

changeset 5398
1f4509cf8f35
parent 5397
fee5485e67f4
child 5402
ce21a78a5fcf
equal deleted inserted replaced
5397:fee5485e67f4 5398:1f4509cf8f35
19 def __init__(self): 19 def __init__(self):
20 """ 20 """
21 Constructor 21 Constructor
22 """ 22 """
23 super(HtmlProvider, self).__init__() 23 super(HtmlProvider, self).__init__()
24
25 def kind(self):
26 """
27 Public method to get the markup kind.
28
29 @return string with markup kind
30 @rtype str
31 """
32 return "html"
24 33
25 def hasBold(self): 34 def hasBold(self):
26 """ 35 """
27 Public method to indicate the availability of bold markup. 36 Public method to indicate the availability of bold markup.
28 37
47 @return flag indicating the availability of strikethrough markup 56 @return flag indicating the availability of strikethrough markup
48 @rtype bool 57 @rtype bool
49 """ 58 """
50 return True 59 return True
51 60
61 def headerLevels(self):
62 """
63 Public method to determine the available header levels.
64
65 @return supported header levels
66 @rtype int
67 """
68 return 6
69
52 def bold(self, editor): 70 def bold(self, editor):
53 """ 71 """
54 Public method to generate bold text. 72 Public method to generate bold text.
55 73
56 @param editor reference to the editor to work on 74 @param editor reference to the editor to work on
74 @param editor reference to the editor to work on 92 @param editor reference to the editor to work on
75 @type Editor 93 @type Editor
76 """ 94 """
77 self.__insertMarkup("del", editor) 95 self.__insertMarkup("del", editor)
78 96
97 def header(self, editor, level):
98 """
99 Public method to generate a header.
100
101 @param editor reference to the editor to work on
102 @type Editor
103 @param level header level
104 @type int
105 """
106 if level <= 6:
107 self.__insertMarkup("h{0}".format(level), editor)
108
79 def __insertMarkup(self, markup, editor): 109 def __insertMarkup(self, markup, editor):
80 """ 110 """
81 Private method to insert the specified markup. 111 Private method to insert the specified markup.
82 112
83 If the editor has selected text, this text is enclosed by the given 113 If the editor has selected text, this text is enclosed by the given

eric ide

mercurial