0.0
No commit activity in last 3 years
No release in over 3 years
Pointillist converts Atom stylesheets for use by Ruby, as a replacement to Pygments.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
 Project Readme

Pointillist

Convert Atom stylesheets into Pygments-compatible syntax highlighting.

Creating new languages

You'll need CoffeeScript installed. You'll also need cson installed, globally:

npm install -g cson

With that out of the way, you can now run script/add-language, which takes two arguments:

  1. The GitHub username/repository with a language file you're interested in
  2. The name of the <grammer>.cson file you want to copy.

For example, to fetch Atom's CoffeeScript highlighting, you'd invoke:

script/add-language atom/language-coffee-script coffeescript

That second coffeescript string comes from the fact that the filename under grammars is called coffeescript.cson.

How does it work?

Textpow does most of the heavy lifting. It reads YAML files of TextMate language definitions, and expects a processor to transform a string into some desirable output--in this case, an HTML document with Pygments class names.

Atom's syntax highlighting consists of CSON files generated from TextMate language definitions. We can easily convert this CSON to JSON, and, since JSON is considered a subset of YAML, we can use Textpow's same YAML.load calls to generate a mapping. All this library really does is define a renderer, called pygments.render, which maps TextMate grammar rules to expected HTML. For example:

begin: <span class="c1">
end: </span>
selector: comment.line.number-sign

In this example, when Textpow detects a string falling within a comment.line.number-sign rule, it wraps it up in <span class="c1">.

What if I don't lke Pygments?

Hey, that's cool. The definition for the HTML output is defined as a YAML file. You could write your own render format as an array of keys containing begin, end, and selector.