Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

endcord-pygments-syntax

An extension for endcord discord TUI client, that adds builtin code blocks syntax highlighting using pygments.
Endcord uses system-installed Pygments (and system python) through "pygmentize" command. As fallback it uses GNU source-highlight, which has a bit less colorful highlighting.
This extension provides pygments to endcord as library, so it doesnt have to be installed on system, and so system python is not required.
Additionally this extension allows to more accurate token-to-color assignments, And to even add more colors.

Installing

See official extensions documentation for installing instructions. Available options:

  • Git clone into Extensions directory located in endcord config directory and run python setup.py.
  • Run endcord -i https://github.com/sparklost/endcord-pygments-syntax
  • Or use endcord client-side command install_extension sparklost/endcord-pygments-syntax

Configuration

All extension options are under [main] section in endcord config. This extension options are always prefixed with ext_pygments_syntax_.

Settings options

ext_pygments_syntax_map = None
This is pygments token name to id map. It will completely override existing builtin map of 12 tokens.
Token ids are just numbers and correspond to index of colors in syntax_token_colors list in endcord config.
Example: {"Name.Class": 0, "Name.Builtin.Pseudo": 1, "Literal.String": 2}
Note that ids start from 0. In this example Name.Builtin.Pseudo token which in python language is self will be colored with second color from syntax_token_colors list.
Use this official pygments demo to to find token names. Paste the code and switch formatter to tokens.

Disclaimer

This extension is usable only in bots which should not be breaking any ToS, but here's a warning anyway:

Warning

Using third-party client is against Discord's Terms of Service and may cause your account to be banned!
Use endcord and/or this extension at your own risk!
If this extension is modified, it may be used for harmful or unintended purposes.
The developer is not responsible for any misuse or for actions taken by users.

About

An extension for endcord discord TUI client, that adds builtin code blocks syntax highlighting using pygments.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages