Greasy Fork is available in English.

Lazyfoo Highlight Code

Add code highlight to LazyFoo's code snippets in the tutorials section, updated to HLJS 11.6, no jQuery, switchable theme.

Δημιουργός
jamescodesthings
Ημερήσιες εγκαταστάσεις
0
Σύνολο εγκαταστάσεων
6
Βαθμολογίες
0 0 0
Έκδοση
1.5
Δημιουργήθηκε την
21/07/2022
Ενημερώθηκε την
21/07/2022
Μέγεθος
2 KB
Άδεια
MIT
Εφαρμόζεται σε

LazyFoo syntax hightlighing

This is an updated fork of https://greasyfork.org/en/scripts/24030-lazyfoo-highlight-code

Updates

  • Fixed GM_getResourceText use
  • Fixed @include rule and updated to @match
  • Removed JQuery Dependecy
  • Updated HLJS to 11.6
  • Added the default dark mode theme from hljs
  • Added a switch to allow for switching to default theme.
  • Added a fallback that works without GM_getResourceText for use with https://apps.apple.com/gb/app/userscripts/id1463298887

Choosing a different theme

You can pick other themes here: https://highlightjs.org/static/demo/

And use the .css file from a CDN here: https://cdnjs.com/libraries/highlight.js

Example:

// @resource    A11Y_DARK https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/styles/a11y-dark.min.css
//...
const themeCss = GM_getResourceText("A11Y_DARK");