Raised This Month: $ Target: $400
 0% 

Syntax highlight for [code] blocks


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 03-02-2018 , 07:54   Syntax highlight for [code] blocks
Reply With Quote #1

ViolentMonkey/TamperMonkey/GreaseMonkey/WhateverMonkey script that highlights all those uncolored [code] blocks by automatically attempting to recognize what language is used within them. Uses highlight.js library to achieve this.
Download: https://gist.github.com/rsKliPPy/31c...hlight.user.js


Examples:

JSON:


Markdown:


Python:
__________________

Last edited by klippy; 03-02-2018 at 07:54.
klippy is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 03-02-2018 , 22:00   Re: Syntax highlight for [code] blocks
Reply With Quote #2

Another wonderful work from you, KliPPy.

Here, have some
cravenge is offline
sekac
Senior Member
Join Date: Nov 2016
Old 06-20-2018 , 15:13   Re: Syntax highlight for [code] blocks
Reply With Quote #3

Hey, is there an AMXX language for highlight.js? If not would you be able to make that?
sekac is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 06-20-2018 , 15:29   Re: Syntax highlight for [code] blocks
Reply With Quote #4

C is good enough for it, I didn't want to add many languages because then hl.js has harder time deciding what language it actually is in the [code] block.
__________________
klippy is offline
sekac
Senior Member
Join Date: Nov 2016
Old 06-20-2018 , 16:07   Re: Syntax highlight for [code] blocks
Reply With Quote #5

Quote:
Originally Posted by KliPPy View Post
C is good enough for it, I didn't want to add many languages because then hl.js has harder time deciding what language it actually is in the [code] block.
Well I need this for my website, so I can specify the language in the code tags.
sekac is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode