Uses HLJS to add syntax highlighting to kbin.

  • 0.1 - Initial launch, basic support with singular theme.
  • 0.2 - Update to remove unnecessary code.
  • 0.3 - Add support for stylesheet URLs to be specified in settings and to be stored in memory.
  • 0.3.1 - Added support for numerous kbin instances.
  • 0.4 - Preloads a dropdown with predefined stylesheets for ease of use. Reworked how stylesheets are stored. Added header for code sections that displays what language code section is in (unless poster specifies, this is best-guess based on HLJS). Added clipboard copy button and made code section collapsible.

Example, 0.1 - PowerShell
Example, 0.3 - Side by side
Example, 0.4 - JavaScript
Example, 0.4 - New functionality
Example, 0.4 - Settings and themes

  • shazbot@kbin.social
    link
    fedilink
    arrow-up
    3
    ·
    3 years ago

    Very nice. Only thing I didn’t like was the addition of a white border in code blocks. Added .hljs { border: 0px; } to my theme

  • 0rito@kbin.socialOP
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    3 years ago

    0.4 was just merged to main. You should update automatically if you’re on 0.2. If you want to update immediately, simply click here. Notes and examples have been updated in OP.

    Worth noting that some of the changes in this version are to make it easier to integrate with @shazbot megamod.

  • 0rito@kbin.socialOP
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    Just pushed version 0.3 to GitHub. If you’re on version 0.2, you should get an update automatically (eventually). If you’re on version 0.1, you can update by going following this link.

    Only one major change… I’ve added options similar to KES’ to allow you to specify a hljs stylesheet outside of code.

    kbin-code-highlighting v0.3 - settings