Giter VIP home page Giter VIP logo

pygments-server's People

Contributors

csilvers avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pygments-server's Issues

Allowing to pass options to url resp. pygments

A long time we were searching for a solution to solve the performance problems with the Mediawiki SyntaxHightlight extension which calls python for each code block separately. Before we got completely frustrated we came across this project which solved our issue. Thank you very much for it.
To let the pymets-server run together with SyntaxHighlight we modified the main.py a bit because we needed to pass certain options (e. g. cssclass) to the pygments formatter.

To avoid such hacks which could also occur in other use cases, we suggest to add an "options" url parameter (maybe "style" should be removed then) to the pygmentize server method which then passes them into the function call of _get_formatter_by_name(alias, **options). When calling pygmetize with Python such option are passed like -O cssclass=mw-highlight,encoding=utf-8. Maybe the url could then be like this: http://server:port?lang=sql&options=cssclass%3Dmw-highlight%2Cencoding%3Dutf-8. Of course, another flexible format is also possible. Finally, the options parameter is then taken, decoded and decomposed before it is passed to the method get_formatter_by_name.

We would be very grateful if somebody comments or even works on this feature.

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.