QScintilla/MarkupProviders/RestructuredTextProvider.py

changeset 5402
ce21a78a5fcf
parent 5398
1f4509cf8f35
child 5404
6b19ad5470a3
equal deleted inserted replaced
5401:dbbbd94aec0b 5402:ce21a78a5fcf
40 @return flag indicating the availability of bold markup 40 @return flag indicating the availability of bold markup
41 @rtype bool 41 @rtype bool
42 """ 42 """
43 return True 43 return True
44 44
45 def bold(self, editor):
46 """
47 Public method to generate bold text.
48
49 @param editor reference to the editor to work on
50 @type Editor
51 """
52 self.__insertMarkup("**", editor)
53
45 def hasItalic(self): 54 def hasItalic(self):
46 """ 55 """
47 Public method to indicate the availability of italic markup. 56 Public method to indicate the availability of italic markup.
48 57
49 @return flag indicating the availability of italic markup 58 @return flag indicating the availability of italic markup
50 @rtype bool 59 @rtype bool
51 """ 60 """
52 return True 61 return True
53 62
63 def italic(self, editor):
64 """
65 Public method to generate italic text.
66
67 @param editor reference to the editor to work on
68 @type Editor
69 """
70 self.__insertMarkup("*", editor)
71
54 def headerLevels(self): 72 def headerLevels(self):
55 """ 73 """
56 Public method to determine the available header levels. 74 Public method to determine the available header levels.
57 75
58 @return supported header levels 76 @return supported header levels
59 @rtype int 77 @rtype int
60 """ 78 """
61 return len(self.__headerChars) 79 return len(self.__headerChars)
62
63 def bold(self, editor):
64 """
65 Public method to generate bold text.
66
67 @param editor reference to the editor to work on
68 @type Editor
69 """
70 self.__insertMarkup("**", editor)
71
72 def italic(self, editor):
73 """
74 Public method to generate italic text.
75
76 @param editor reference to the editor to work on
77 @type Editor
78 """
79 self.__insertMarkup("*", editor)
80 80
81 def header(self, editor, level): 81 def header(self, editor, level):
82 """ 82 """
83 Public method to generate a header. 83 Public method to generate a header.
84 84
99 editor.insertAt( 99 editor.insertAt(
100 lineLength * self.__headerChars[level - 1] + lineSeparator, 100 lineLength * self.__headerChars[level - 1] + lineSeparator,
101 cline + 1, 0) 101 cline + 1, 0)
102 editor.setCursorPosition(cline + 2, 0) 102 editor.setCursorPosition(cline + 2, 0)
103 editor.endUndoAction() 103 editor.endUndoAction()
104
105 def hasCode(self):
106 """
107 Public method to indicate the availability of inline code markup.
108
109 @return flag indicating the availability of inline code markup
110 @rtype bool
111 """
112 return True
113
114 def code(self, editor):
115 """
116 Public method to generate inline code text.
117
118 @param editor reference to the editor to work on
119 @type Editor
120 """
121 self.__insertMarkup("``", editor)
104 122
105 def __insertMarkup(self, markup, editor): 123 def __insertMarkup(self, markup, editor):
106 """ 124 """
107 Private method to insert the specified markup. 125 Private method to insert the specified markup.
108 126

eric ide

mercurial