GithubHelp home page GithubHelp logo

haproxy-pygments-lexer's Introduction

Pygments Lexer for the HAProxy configuration syntax

This package enables the latest HAProxy configuration syntax highlighting for python Pygments and is used as the basis for the HAProxy lexer on the Pygments project.

The lexer keywords are maintained and updated manually using information from the documentation of the HAProxy Community version and the HAProxy Enterprise version.

Installation

To add the lexer on your already existing pygments installation run:

python setup.py install

This will install the lexer on your local system and create a python package.

To verify that the lexer is working use the sample HAProxy configuration file.

# Output the result on your command line
pygmentize -l haproxy -x haproxy.cfg

# Output the result in an HTML file
pygmentize -O full -l haproxy -o haproxy.html haproxy.cfg

Development

The main grammar rules and keywords are located under haproxylexer.

  • _haproxy_builtins.py contains lists of keywords.
  • lexer.py contains all the grammar regexes

To quickly test your changes you can run:

pygmentize -l ./haproxylexer/lexer.py:HAProxyLexer -x haproxy.cfg

Contributing

Pull requests and patches will be checked out by the maintainer and merged. Try to keep your commit messages precise and to the point.

Thanks and resources

Many thanks for the lovely Python, PyPi, and Pygments documentation.

Also a shout out to Bojan Marcovic for his vscode-haproxy-syntax and Alexander Bulimov for his atom-language-haproxy. Both were a great starting resources and the work done here will be also now easier to port for editors like VS Code, Atom, Sublime, etc.

Funny little disclaimer

The author, has never actually taken the time to learn python...

He just hacked away at this. Please forgive him for any coding "faux passes" he might have done :)

haproxy-pygments-lexer's People

Contributors

niktwenty3 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.