[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master cae3b72 240/271: Document new dispatch API.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master cae3b72 240/271: Document new dispatch API. |
Date: |
Thu, 05 Feb 2015 18:31:35 +0000 |
branch: master
commit cae3b72dedf16449220a026eb140d0ccbb580889
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Document new dispatch API.
---
README.md | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 14f4f1a..af1be13 100644
--- a/README.md
+++ b/README.md
@@ -91,8 +91,9 @@ theme used in the screenshot above).
## Extending
-To add support for a new language, write a "scopifier" for it, and add an entry
-to `context-coloring-dispatch-plist`. Then the plugin should handle the rest.
+To add support for a new language, write a "scopifier" for it, and define a new
+coloring dispatch strategy with `context-coloring-define-dispatch`. Then the
+plugin should handle the rest.
A "scopifier" is a CLI program that reads a buffer's contents from stdin and
writes a JSON array of numbers to stdout. Every three numbers in the array
@@ -123,6 +124,24 @@ If there is an abstract syntax tree generator for your
language, you can walk
the syntax tree, find variables and scopes, and build their positions and
levels
into an array like the one above.
+For example, a Ruby scopifier might be defined and implemented like this:
+
+```lisp
+(context-coloring-define-dispatch 'ruby
+ :modes '(ruby-mode)
+ :executable "ruby"
+ :command "/home/username/scopifier")
+```
+
+```ruby
+#!/usr/bin/env ruby
+def scopifier(code)
+ # Parse code.
+ # Return an array.
+end
+print scopifier ARGF.read
+```
+
[linter]: http://jshint.com/about/
[flycheck]: http://www.flycheck.org/
[zenburn]: http://github.com/bbatsov/zenburn-emacs
- [elpa] master 6ce2b63 184/271: Bump required js2-mode version., (continued)
- [elpa] master 6ce2b63 184/271: Bump required js2-mode version., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d1cb93b 241/271: Merge branch 'feature/dispatch' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master e05f044 191/271: Update js2-mode., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 04f6f73 185/271: Documentation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master ed2c33d 121/271: Merge branch 'feature/color-schemer' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master 196a6ed 209/271: Whoops., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 887f4c7 215/271: Merge branch 'master' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master 6706bc2 218/271: Merge branch 'develop', Jackson Ray Hamilton, 2015/02/05
- [elpa] master d813892 115/271: Add color-schemer utility., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fadacd1 180/271: Add badge., Jackson Ray Hamilton, 2015/02/05
- [elpa] master cae3b72 240/271: Document new dispatch API.,
Jackson Ray Hamilton <=
- [elpa] master fedf885 269/271: Add note to readme about --version., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d1715b2 177/271: Remove .gitignore entry., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 6e5e95a 211/271: Pass key-value pair test., Jackson Ray Hamilton, 2015/02/05
- [elpa] master bbebea1 253/271: Merge branch 'develop', Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7059157 187/271: Add note on byte compilation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 8300976 244/271: Merge branch 'master' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9a883e2 217/271: Version 2.1.0., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 34fb7e9 267/271: Fix readme link., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9fdc037 243/271: Merge branch 'develop', Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7001dce 201/271: Use js2-node-top-level-decl-p as a fast track., Jackson Ray Hamilton, 2015/02/05