This commit is contained in:
Will McGugan 2020-09-13 13:16:55 +01:00
parent d21823440f
commit 2dda2e80b2
1 changed files with 6 additions and 2 deletions

View File

@ -174,10 +174,14 @@ class Syntax(JupyterMixin):
return style
def highlight(self, code: str = None) -> Text:
"""Highlight a string with the given lexter and return a Text instance.
"""Highlight code and return a Text instance.
Args:
code (Optional[str], optional). Highlight code if a str is given, or
None to use self.code.
Returns:
Text: A text instance containing highlights.
Text: A text instance containing syntax highlight.
"""
if code is None:
code = self.code