khan / pygments-server Goto Github PK
View Code? Open in Web Editor NEWA simple server that provides HTTP access to `pygmentize`
License: MIT License
A simple server that provides HTTP access to `pygmentize`
License: MIT License
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.