-
Notifications
You must be signed in to change notification settings - Fork 410
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 prism.js
highlighting
#3746
base: master
Are you sure you want to change the base?
Improve prism.js
highlighting
#3746
Conversation
Hey! Could you describe a bit on your use-cases for most of the changes? Specifically for including support for ±300 languages. |
Here's my usecases/reasons for each of the changes:
not sure how many languages would be left after pruning them, but it'd probably be much less. |
Hi, I really like the idea of adding more styling support, but I have some concerns about adding so many files. Adding these files introduces maintenance and testing requirements on the Dokka team. Dokka has a slow release cycle. so I think it's likely that these scripts would become outdated. Adding these files could interfere with users who want to use a different highlighting library. |
I'm going to look at pruning a bunch of the niche languages. hopefully that should substantially decrease the file count.
the last time prism.js was updated was august 23, 2022, so I don't think that's an issue.
how would it interfere with users any more than the current prism.js highlighter in dokka?
yeah, it could be done per-project, but it's also kinda annoying to have to check in a bunch of |
- plugin changes: - add `show-language` + `toolbar` plugins: Shows the language of the current codeblock. - add `autoloader`: Used to automatically load languages. - add `match-braces`: when hovering over a bracket, highlight the matching bracket. Added match-braces class to `base.ftl`. - add `diff-highlight`: highlight diff codeblocks in conjunction with other languages. - remove `css` and `javascript` languages from being loaded in the main prism.js file. - Add components directory with all additional `prism.js` supported languages. These are loaded on-demand by the `autoloader` plugin. - Add small transition to the copy code element to match the language toolbar element. (100ms linear transition from 0 -> 100% opacity) - Fix minor bug in FileWriter causing additional empty directories to be created when copying a folder with a trailing slash. - Make the diff highlighting look better Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
43850ee
to
4fc4542
Compare
Alright, I've gone through and pruned some of the less popular languages from 297 languages down to 114 languages. Are there any other languages I should remove as well? I tried to keep it mostly to popular/useful things that someone might use. Another alternative could be to change from I've also rebased on top of master to ensure there were no merge conflicts. |
Any update on this? |
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
I've dropped it down to only 91 languages rather than the original 300-odd languages |
hey, any updates for this? |
Hey! Sorry for the delay, we are busy with preparation for Dokka 2.0.0 and beyond :)
let's continue discussion here, so that it will be easier to track it |
This PR improves the
prism.js
highlighting in a couple of minor ways.show-language
+toolbar
plugins: Shows the language of the current codeblock.autoloader
: Used to automatically load languages.match-braces
: when hovering over a bracket, highlight the matching bracket. Added match-braces class tobase.ftl
.diff-highlight
: highlight diff codeblocks in conjunction with other languages.css
andjavascript
languages from being loaded in the main prism.js file.prism.js
supported languages. These are loaded on-demand by theautoloader
plugin.FileWriter
causing additional empty directories to be created when copying a folder with a trailing slash.