Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlighting support for Python code #17

Open
yonomitt opened this issue Sep 12, 2022 · 8 comments
Open

Syntax highlighting support for Python code #17

yonomitt opened this issue Sep 12, 2022 · 8 comments

Comments

@yonomitt
Copy link
Contributor

After Swift support is added, I would be interested in having support for Python syntax highlighting.

I'm also working on a PythonGrammar for my website, which would plug right into the syntax highlight support added in PR #16... so we could use that, once I finish it.

@zachlucas
Copy link

@yonomitt I'm also hitting a use case for Python syntax highlighting! Any chance you've happened to push a WIP branch? We could collaborate if so! I was thinking maybe this Swift Pygments wrapper could be helpful?

@yonomitt
Copy link
Contributor Author

@zachlucas I think I have something for this, but just got distracted by other work. Let me see if I can get a PR set up this weekend.

@zachlucas
Copy link

Are you planning to use the Swift Pygments wrapper? I figure that would be great to use so we don't have to roll our own formatting. We'd have to get a bridge from that to DeckUI though

@yonomitt
Copy link
Contributor Author

Sorry I haven't gotten a chance to finish this. I'm not planning on using Swift Pygments. I tried using it a while back when I was working on getting Python syntax highlighting support for my Publish site, and didn't like the results.

Instead, I've been working on a Publish-style Grammar for Python. Since the syntax highlighting I added here for Swift is based on that, too, it should be easy to plug this Python Grammar in.

@yonomitt
Copy link
Contributor Author

I've finally pushed my changes to my SplashPython repo. Now all that's left is to integrate it into DeckUI 😄

@yonomitt
Copy link
Contributor Author

@zachlucas Check this out: #28

@yonomitt
Copy link
Contributor Author

If you notice any issues with syntax highlighting in Python, we may need to add syntax rules to SplashPython. I'm sure I'm missing some.

@yonomitt
Copy link
Contributor Author

@zachlucas Just a heads up. I noticed that SplashPython did not properly tokenize multiline strings. I've fixed this and tagged a new version of SplashPython (1.1.0). If you're using the unmerged DeckUI branch from my PR, you might want to update that package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants