syntaxhighlighters
Class info
Classes
| Name | Children | Inherits |
|---|---|---|
| BaseRuleSyntaxHighlighter prettyqt.syntaxhighlighters.baserulesyntaxhighlighter |
||
| HighlightRule prettyqt.syntaxhighlighters.highlightrule A highlighting rule, configured via class attributes of subclasses. |
|
|
| JsonHighlighter prettyqt.syntaxhighlighters.jsonhighlighter |
||
| MarkdownHighlighter prettyqt.syntaxhighlighters.markdownhighlighter |
||
| PygmentsHighlighter prettyqt.syntaxhighlighters.pygmentshighlighter Syntax highlighter that uses Pygments for parsing. |
||
| PythonHighlighter prettyqt.syntaxhighlighters.pythonhighlighter Syntax highlighter for the Python language. |
||
| RegexMatchHighlighter prettyqt.syntaxhighlighters.regexmatchhighlighter |
||
| SelectedWordHighlighter prettyqt.syntaxhighlighters.selectedwordhighlighter |
||
| YamlHighlighter prettyqt.syntaxhighlighters.yamlhighlighter |
🛈 DocStrings
syntaxhighlighters module.
contains some custom syntax highlighers
BaseRuleSyntaxHighlighter
Bases: SyntaxHighlighter
Source code in prettyqt/syntaxhighlighters/baserulesyntaxhighlighter.py
highlightBlock(text: str)
Apply syntax highlighting to the given block of text.
Source code in prettyqt/syntaxhighlighters/baserulesyntaxhighlighter.py
HighlightRule
A highlighting rule, configured via class attributes of subclasses.
Source code in prettyqt/syntaxhighlighters/highlightrule.py
JsonHighlighter
Bases: SyntaxHighlighter
Source code in prettyqt/syntaxhighlighters/jsonhighlighter.py
highlightBlock(text: str)
Highlight a block of code using the rules outlined in the Constructor.
Source code in prettyqt/syntaxhighlighters/jsonhighlighter.py
PygmentsHighlighter
Bases: SyntaxHighlighter
Syntax highlighter that uses Pygments for parsing.
Source code in prettyqt/syntaxhighlighters/pygmentshighlighter.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | |
highlightBlock(string)
Highlight a block of text.
Source code in prettyqt/syntaxhighlighters/pygmentshighlighter.py
set_style_sheet(stylesheet: str)
Sets a CSS stylesheet.
The classes in the stylesheet should correspond to those generated by:
pygmentize -S <style> -f html
Note that "set_style" and "set_style_sheet" completely override each other, i.e. they cannot be used in conjunction.
Source code in prettyqt/syntaxhighlighters/pygmentshighlighter.py
PythonHighlighter
Bases: BaseRuleSyntaxHighlighter
Syntax highlighter for the Python language.
Source code in prettyqt/syntaxhighlighters/pythonhighlighter.py
highlightBlock(text: str)
Apply syntax highlighting to the given block of text.
Source code in prettyqt/syntaxhighlighters/pythonhighlighter.py
match_multiline(text: str, delimiter: core.RegularExpression, in_state: int, style: gui.TextCharFormat)
Do highlighting of multi-line strings.
delimiter should be a
core.RegExp for triple-single-quotes or triple-double-quotes, and
in_state should be a unique integer to represent the corresponding
state changes when inside those strings. Returns True if we're still
inside a multi-line string when this function is finished.