-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
PrismJS AviSynth Support #384
Comments
Requesting input from @TiKevin83 and @vadosnaprimer (even if just for posterity) |
From what we've tried so far, this highlighter in general is insanely limited. It assigns the same color to PILES of unrelated things, like internal function names and strings. Are there any worthy alternatives to prismjs, like something github uses maybe? Until then, this PR is a good addition. |
On the topic of prismjs themes: theres a web interface for making entirely new ones here if that's something people would like to try: http://k88hudson.github.io/syntax-highlighting-theme-generator/www/ Also here's a bunch more premade ones that may be better: https://github.com/PrismJS/prism-themes |
Please report this, including examples. |
Nevermind, it looks like with good themes, there will be no problems. |
I've learned via a short discussion that there isn't an "oficially" supported way to automate the building of PrismJS, but that the author of the program did write a CLI bundler in an unmerged PR. |
@Zinfidel Any chance of getting avs support merged into upstream? |
@nattthebear Because the other options are not great, I've started working on a full PR. So, there's a chance it will get an upstream merge, though it might end up drastically simplified due to performance problems. I'll keep this issue updated. |
Here goes nothing: PrismJS/prism#3071 |
WOW YOU ROCK |
@TiKevin83 Yes it is! |
Preview of the highlighter in action: https://zinfidel.github.io/
Unfortunately, getting this support on the site might pose maintainability problems. I'll try to outline them with solutions on this issue so they can be discussed. The files you customize and download from https://prismjs.com/download.html are not the files that are created when building the node project locally. To get the files needed for the site, you have to build prismjs, then actually run the website locally (the repo you download is actually their entire website/app) and customize your prismjs with your new stuff, and download.
Actual build steps:
npm
installednpm ci
npm run build
npm run start
// starts a local http server hosting the websiteThe primary maintainability problem
I could just hand over the customized prism.js and prism.css files for the site, but I will be customizing that file based on our current desires for languages/themes. In the future if we want to add new language/themes or update prismjs, the avisynth customization is lost. If I'm around and willing to help with new additions, great, otherwise someone needs to be willing to do the above process. There is actually only one new file (
prism-avisynth.js
) that creates the language, and a modification to one file (components.js
) to add it to the customization list.Possible other solutions
Theme/Style-Related Stuff
last
variable is currently set as atoken.variable
which gives a kind of color vomit problem with the default theme. @vadosnaprimer suggested a more pleasant navy blue, but this requires modifying the theme to achieve. If I changetoken.variable
to navy there, all languages are affected. If I add a new category for the color, then only that theme supports it. What's worth doing here?The text was updated successfully, but these errors were encountered: