-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Improve syntax highlighting #651
base: main
Are you sure you want to change the base?
Conversation
This also changes theme to something with better contrast
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts with an infra-y hat on. (Note also this appears to be broken in CI)
task :styles => [:dependencies] do | ||
highlight_css = `bundle exec rougify style github`.strip() | ||
File.write("_sass/_syntax-highlighting.scss", highlight_css) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dynamically generate the syntax highlighting styles, so it's clear where they came from.
I'm not sure this makes it any clearer where the styles come from? Having a comment in the file or something might be an alternative (and would avoid additional compile-time overhead). Even if we also provide the command which generates the file and validate in CI that the file matches that command (the validate-generated-files action can help with the latter)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is, where did the current file come from? It's hard to tell. No need for that if it's generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat, though a comment at the top of the file like:
/* This file was generated by running .... */
Feels like it'd be at least as good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for the sake of source attribution alone, that's functionally the same. But this way, there's no longer a generated file committed into the repository, since it can be easily generated automatically at build time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvement, could you what colour is used for comment lines.
@WillB97 contrast looks pretty good for comments: |
It's included in the main bundle
Fixes #530
This PR makes 2 main changes:
Images