Open mattharrison opened 3 months ago
I don't know of any sublime-syntax
files which can currently highlight doctests correctly. Theoretically if we were to create one, it would be a lot easier to extend the base Python sublime-syntax to add support for it, so probably we'd need to wait for https://github.com/trishume/syntect/pull/536 to be merged first
Where do these syntax definitions live? I poked around a little and couldn't find them.
On Fri, Aug 9, 2024, 11:46 PM Keith Hall @.***> wrote:
I don't know of any sublime-syntax files which can currently highlight doctests correctly. Theoretically if we were to create one, it would be a lot easier to extend the base Python sublime-syntax to add support for it, so probably we'd need to wait for #536 https://github.com/trishume/syntect/pull/536 to be merged first
— Reply to this email directly, view it on GitHub https://github.com/trishume/syntect/issues/549#issuecomment-2279477958, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA5E3INQBFYMWSHAMKMU7LZQWSLZAVCNFSM6AAAAABMJIRLXKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZZGQ3TOOJVHA . You are receiving this because you authored the thread.Message ID: @.***>
Mainly in the Packages folder/submodule of the testdata folder: https://github.com/trishume/syntect/tree/master/testdata
Description: Syntect currently lacks support for highlighting Python console output (characterized by
>>>
and...
prompts) and doctests. This limitation hinders its ability to accurately represent Python code in various contexts, including code examples, tutorials, and interactive sessions.Expected Behavior: Syntect should correctly highlight the Python code while ignoring the
>>>
,...
, and output (stacktrace or stdout).Steps to Reproduce:
Create a code snippet containing Python console output or a doctest:
Note this language is commonly called
pycon
(for python console), and tools like Pygments or Github markdown support this language (as evidenced by highlighting the above code).(My desire is because I'm exploring Typst and want like to port my books from LaTeX to Typst. See this bug https://github.com/typst/typst/issues/4661 )