joshdholtz / DeckUI

Swift DSL for writing slide decks in Xcode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syntax highlighting support for Python code

yonomitt opened this issue · comments

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.

@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?

@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.

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

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.

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

@zachlucas Check this out: #28

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.

@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.