stratus-color

0.0.1 • Public • Published

Stratus:Color

Build Status

It works from the command line, or the browser, and is used by Stratus Editor.

Syntax languages are installed using stratus-bundle.

Install

Be sure you have stratus-bundle.

npm install -g stratus-color

CLI

Writes highlighted version of somefile.rb to ./somefile.rb.html, including the CSS for the theme.

$ stratus-color --file somefile.rb -s

Writes highlighted version of somefile.rb to ./somefile.rb.html, without the CSS for the theme.

$ stratus-color --file somefile.rb

API

color(text, rules, context)

Highlight a string

color = require 'stratus-color'

code = """def hello()
  puts "Hello, world"
end"""

color code, "Ruby"
# =>
# "<div>... the highlighted code ...</div>"

color code, "Ruby", format: "json"
# =>
# [ [... list of tokens for line 0 ...]
# , [... line 1 ...]
# , [...]
# ]

color.file(path, options?, callback)

Highlight a file

color.file "path/to/file.rb", (err, html) ->
  # ...

List of syntaxes

Writing syntaxes

License

See LICENSE.

Readme

Keywords

none

Package Sidebar

Install

npm i stratus-color

Weekly Downloads

1

Version

0.0.1

License

none

Last publish

Collaborators

  • sentientwaffle