--- a/QScintilla/MarkupProviders/MarkdownProvider.py Fri Jan 06 18:28:14 2017 +0100 +++ b/QScintilla/MarkupProviders/MarkdownProvider.py Fri Jan 06 20:00:52 2017 +0100 @@ -40,6 +40,15 @@ """ return True + def bold(self, editor): + """ + Public method to generate bold text. + + @param editor reference to the editor to work on + @type Editor + """ + self.__insertMarkup("**", editor) + def hasItalic(self): """ Public method to indicate the availability of italic markup. @@ -49,6 +58,15 @@ """ return True + def italic(self, editor): + """ + Public method to generate italic text. + + @param editor reference to the editor to work on + @type Editor + """ + self.__insertMarkup("_", editor) + def hasStrikethrough(self): """ Public method to indicate the availability of strikethrough markup. @@ -58,6 +76,15 @@ """ return True + def strikethrough(self, editor): + """ + Public method to generate strikethrough text. + + @param editor reference to the editor to work on + @type Editor + """ + self.__insertMarkup("~~", editor) + def headerLevels(self): """ Public method to determine the available header levels. @@ -67,33 +94,6 @@ """ return 6 - def bold(self, editor): - """ - Public method to generate bold text. - - @param editor reference to the editor to work on - @type Editor - """ - self.__insertMarkup("**", editor) - - def italic(self, editor): - """ - Public method to generate italic text. - - @param editor reference to the editor to work on - @type Editor - """ - self.__insertMarkup("_", editor) - - def strikethrough(self, editor): - """ - Public method to generate strikethrough text. - - @param editor reference to the editor to work on - @type Editor - """ - self.__insertMarkup("~~", editor) - def header(self, editor, level): """ Public method to generate a header. @@ -112,6 +112,24 @@ editor.setCursorPosition(cline, level + 1) editor.endUndoAction() + def hasCode(self): + """ + Public method to indicate the availability of inline code markup. + + @return flag indicating the availability of inline code markup + @rtype bool + """ + return True + + def code(self, editor): + """ + Public method to generate inline code text. + + @param editor reference to the editor to work on + @type Editor + """ + self.__insertMarkup("`", editor) + def __insertMarkup(self, markup, editor): """ Private method to insert the specified markup.