Code Highlight

Alexandre Vicenzi edited this page Jun 24, 2018 · 7 revisions

Flex uses Pygments for code highlight and has a lot of styles ready for use. You just need to pick up one from below:

  • abap
  • algol
  • algol_nu
  • arduino
  • autumn
  • borland
  • bw
  • colorful
  • default
  • emacs
  • friendly
  • fruity
  • github
  • igor
  • lovelace
  • manni
  • monokai
  • murphy
  • native
  • paraiso-dark
  • paraiso-light
  • pastie
  • perldoc
  • rainbow_dash
  • rrt
  • tango
  • trac
  • vim
  • vs
  • xcode

And set it in your pelicanconf.py.

PYGMENTS_STYLE = 'monokai'

You can see how most of this styles looks like at Pygments Demo.

How to add new Styles?

Except for github all other styles are built in from Pygments. If you want to add a new one, you need to find a Python package that is what you want or you can create your own.

After this, you can run the tool inside Flex to generate all Pygments CSS files and run gulp to minify.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.