Coder Social home page Coder Social logo

sygments's Introduction

Scala William's Sygments: Visual Pygments for Scala

What is it?

Sygments is a syntax highlighting service and HTML5 app that uses Pygments.

Pygments is an excellent program syntax highlighter developed in Python.

Sygments lets you try different Pygments themes against a range of programming languages, including custom backgrounds.

It is especially suited for creating presentations.

See the demo at (http://demo.scalawilliam.com/sygments/).

Sample

Here is a sample rendering. It looks lovely:

A cut out from the slides

What problem does it solve?

I originally created part of this application when working on the presentation of the XML Processing in Scala paper I co-authored with @fancellu.

Syntax highlighter themes do not work well with custom backgrounds. I had chosen a background in Google Presentations but it did not work nicely with IntelliJ's highlighting for XQuery and Scala.

  1. Finding the right syntax highlighting theme for the background you've chosen

  2. Highlighting your code so it is ready to be copy-and-pasted straight into Google Presentation or other targets

Out of the initial manual work, I created this nice usable app.

Instructions

  1. Install Java and SBT
  2. run sbt play/run
  3. Go to (http://localhost:9000/)

Reverse-proxying

If you want to host this behind an nginx reverse proxy and need to configure a context path, then add the -DcontextPath=/some/place to the above line of code.

Performance

Highlighter interface performance:

Interface performance

Technology stack

  • sbt
  • Play 2.4
  • materialize-css
  • Jython
  • Scalatest

Copyrights

Please refer to source material for copyright detail. The intention of this code is fair use, attributing authors via a web link.

Sygments back end code is available under the MIT license.

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.