usdmanager.highlighter module¶
Custom syntax highlighters.
-
class
usdmanager.highlighter.
Highlighter
(parent=None, master=None)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
-
masterClass
¶ alias of
MasterHighlighter
-
-
class
usdmanager.highlighter.
MasterHighlighter
(parent, enableSyntaxHighlighting=False, programs=None)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Master object containing shared highlighting rules.
-
comment
= '#'¶
-
dirtied
¶ Used by autodoc_mock_imports.
-
extensions
= [None]¶
-
multilineComment
= None¶
-
setLinkPattern
(programs, dirty=True)[source]¶ Set the rules to search for files based on file extensions, quotes, etc.
Parameters: - programs : dict
extension: program pairs of strings.
- dirty : bool
If we should trigger a rehighlight or not.
-
setSyntaxHighlighting
(enable, force=True)[source]¶ Enable/Disable syntax highlighting. If enabling, dirties the state of this highlighter so highlighting runs again.
Parameters: - enable : bool
Whether or not to enable syntax highlighting.
- force : bool
Force re-enabling syntax highlighting even if it was already enabled. Allows force rehighlighting even if nothing has really changed.
-
-
usdmanager.highlighter.
createMultilineRule
(startPattern, endPattern, color=None, darkColor=None, weight=None, italic=False, cs=<sphinx.ext.autodoc.importer._MockObject object>)[source]¶ Create a multiline syntax highlighting rule.
Parameters: - startPattern : str
RegEx to match for the start of the block of lines.
- endPattern : str
RegEx to match for the end of the block of lines.
- color : QtGui.QColor
Color to highlight matches
- darkColor : QtGui.QColor
Color to highlight matches when in a dark background theme.
- weight : int | None
Optional font weight for matches
- italic : bool
Set the font to italic
- cs : int
Case sensitivity for RegEx matching
Returns: Tuple of QtCore.QRegExp and QtGui.QTextCharFormat objects.
Rtype: tuple
-
usdmanager.highlighter.
createRule
(pattern, color=None, darkColor=None, weight=None, italic=False, cs=<sphinx.ext.autodoc.importer._MockObject object>)[source]¶ Create a single-line syntax highlighting rule.
Parameters: - pattern : str
RegEx to match
- color : QtGui.QColor
Color to highlight matches when in a light background theme
- darkColor : QtGui.QColor
Color to highlight matches when in a dark background theme. Defaults to color if not given.
- weight : int | None
Optional font weight for matches
- italic : bool
Set the font to italic
- cs : int
Case sensitivity for RegEx matching
Returns: Tuple of QtCore.QRegExp and QtGui.QTextCharFormat objects.
Rtype: tuple