-
Notifications
You must be signed in to change notification settings - Fork 166
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
[MRG] Add syntax highlighting to code blocks #110
base: master
Are you sure you want to change the base?
Commits on Sep 3, 2021
-
I think the Effect may make it difficult/impossible to apply syntax highlighting to static text
Configuration menu - View commit details
-
Copy full SHA for 9fe2ceb - Browse repository at this point
Copy the full SHA 9fe2cebView commit details
Commits on Sep 4, 2021
-
Render highlighted text on slide w/ placeholder
The paint() function seems like the simplest way of rendering highlighted text, and it's only available on Screen or Canvas objects. This is why I'm not using an Effect for a code block.
Configuration menu - View commit details
-
Copy full SHA for 08b6f1f - Browse repository at this point
Copy the full SHA 08b6f1fView commit details -
We are no longer calling the _code() function, so we don't need to store the data in the same way. The code element tells us what to render, and the row will tell us where to place it on the slide. _code() will be removed later.
Configuration menu - View commit details
-
Copy full SHA for 904015c - Browse repository at this point
Copy the full SHA 904015cView commit details -
Refactor into function for rendering entire block
From this function we should be able to get the language from the block, then highlight and paint line by line
Configuration menu - View commit details
-
Copy full SHA for 98982e7 - Browse repository at this point
Copy the full SHA 98982e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9a6452e - Browse repository at this point
Copy the full SHA 9a6452eView commit details -
Avoid going out of range on the slides index
Once we get to the restart page, the animation loop keeps running and we get an error if we try to set `cur_slide` normally.
Configuration menu - View commit details
-
Copy full SHA for 9b195dd - Browse repository at this point
Copy the full SHA 9b195ddView commit details
Commits on Sep 6, 2021
-
Configuration menu - View commit details
-
Copy full SHA for abadc0f - Browse repository at this point
Copy the full SHA abadc0fView commit details -
Switch parsers and don't use raw_text prop
This solves the character rendering problems
Configuration menu - View commit details
-
Copy full SHA for cf796e1 - Browse repository at this point
Copy the full SHA cf796e1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5f9a6c8 - Browse repository at this point
Copy the full SHA 5f9a6c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01f243a - Browse repository at this point
Copy the full SHA 01f243aView commit details
Commits on Sep 7, 2021
-
Add to code_blocks directly instead of effects
I don't like modifying slide.code_blocks in the get_effects function. The reason I'm doing it is because that is where we determine what row the code block will go on.
Configuration menu - View commit details
-
Copy full SHA for b76a280 - Browse repository at this point
Copy the full SHA b76a280View commit details -
Refactor relationship between Slide and Slideshow
I don't want to get too carried away with this type of thing for this PR. I'm doing this to hopefully make it more obvious where code_blocks is coming from.
Configuration menu - View commit details
-
Copy full SHA for f866e19 - Browse repository at this point
Copy the full SHA f866e19View commit details -
Configuration menu - View commit details
-
Copy full SHA for 62ed159 - Browse repository at this point
Copy the full SHA 62ed159View commit details -
Reorder imports & rename variable
This is just a bit of cleanup for organization & clarity.
Configuration menu - View commit details
-
Copy full SHA for e8f8e55 - Browse repository at this point
Copy the full SHA e8f8e55View commit details -
Refactor has_code to be based on code_blocks
I tested this change by putting a fireworks effect on the slide and checking to see if I got the ValueError.
Configuration menu - View commit details
-
Copy full SHA for c6041b8 - Browse repository at this point
Copy the full SHA c6041b8View commit details -
Use a custom asciimatics renderer instead
This feels more in line with the Scene/Effect structure of the project.
Configuration menu - View commit details
-
Copy full SHA for 952e692 - Browse repository at this point
Copy the full SHA 952e692View commit details -
Configuration menu - View commit details
-
Copy full SHA for f0d1405 - Browse repository at this point
Copy the full SHA f0d1405View commit details -
This doesn't change the functionality - I'm just doing this since there isn't a particular reason to remove them, and I want to make the PR diff smaller.
Configuration menu - View commit details
-
Copy full SHA for c5ce9b2 - Browse repository at this point
Copy the full SHA c5ce9b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for d564b3c - Browse repository at this point
Copy the full SHA d564b3cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4db2276 - Browse repository at this point
Copy the full SHA 4db2276View commit details -
Configuration menu - View commit details
-
Copy full SHA for 972eccf - Browse repository at this point
Copy the full SHA 972eccfView commit details
Commits on Sep 15, 2021
-
Don't try to guess the language
A user might use a code block and intentionally leave out the language for displaying logs or other things.
Configuration menu - View commit details
-
Copy full SHA for 0675d97 - Browse repository at this point
Copy the full SHA 0675d97View commit details