AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Off-Topic (https://forums.alliedmods.net/forumdisplay.php?f=15)
-   -   Syntax highlight for [code] blocks (https://forums.alliedmods.net/showthread.php?t=305732)

klippy 03-02-2018 06:54

Syntax highlight for [code] blocks
 
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:
https://i.imgur.com/qpW0AfF.png

Markdown:
https://i.imgur.com/Q8sDGnf.png

Python:
https://i.imgur.com/rwpa3HF.png

cravenge 03-02-2018 21:00

Re: Syntax highlight for [code] blocks
 
Another wonderful work from you, KliPPy. :up:

Here, have some :bacon!::bacon!::bacon!:

sekac 06-20-2018 14:13

Re: Syntax highlight for [code] blocks
 
Hey, is there an AMXX language for highlight.js? If not would you be able to make that?

klippy 06-20-2018 14:29

Re: Syntax highlight for [code] blocks
 
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.

sekac 06-20-2018 15:07

Re: Syntax highlight for [code] blocks
 
Quote:

Originally Posted by KliPPy (Post 2598225)
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.


All times are GMT -4. The time now is 07:10.

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