[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 903d938 176/271: Update readme.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 903d938 176/271: Update readme. |
Date: |
Thu, 05 Feb 2015 18:30:58 +0000 |
branch: master
commit 903d938ed8b6a680d43d971ab0dd1c9adcfd8821
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Update readme.
---
README.md | 61 ++++++++++++++++++++++++++++++++-----------------------------
1 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/README.md b/README.md
index 780f66f..10595e2 100644
--- a/README.md
+++ b/README.md
@@ -38,14 +38,32 @@ code*.
- Async (1124 lines): 0.17 seconds
- mkdirp (98 lines): 0.09 seconds
-## Extending
+## Usage
+
+Requires Emacs 24+.
+
+JavaScript language support requires either [js2-mode][] or
+[Node.js 0.10+][node], respectively.
+
+- Clone this repository.
+
+```bash
+cd ~/.emacs.d/
+git clone https://github.com/jacksonrayhamilton/context-coloring.git
+```
+
+- Add the following to your `~/.emacs` file:
+
+```lisp
+(add-to-list 'load-path "~/.emacs.d/context-coloring")
+(require 'context-coloring)
+(add-hook 'js-mode-hook 'context-coloring-mode)
+```
-It would be great if this package supported more languages. I welcome any pull
-request that adds new language support.
+## Extending
-Extension is relatively straightforward. Write a "scopifier" for the language
of
-your choice, add an entry to `context-coloring-dispatch-plist`, and the plugin
-should handle the rest.
+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.
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
@@ -64,36 +82,21 @@ then the scopifier would produce the following array:
Where, for every three numbers, the first number is a 1-indexed start
[point][],
the second number is an exclusive end point, and the third number is a scope
-level. The result of applying level 0 coloring to the range
-\[1, 24) and then applying level 1 coloring to the range \[9, 23) would result
in the following coloring:
+level. The result of applying level 0 coloring to the range [1, 24) and
then
+applying level 1 coloring to the range [9, 23) would result in the
following
+coloring:
<p align="center">
- <img alt="Screenshot of ranges [1, 24) and [9, 23)."
src="scopifier-example.png" title="Screenshot">
+ <img alt="Screenshot of ranges [1, 24) and [9, 23)."
src="scopifier-example.png" title="Screenshot">
</p>
-## Usage
-
-Requires Emacs 24+.
-
-JavaScript language support requires [Node.js 0.10+][node].
-
-- Clone this repository.
-
-```bash
-cd ~/.emacs.d/
-git clone https://github.com/jacksonrayhamilton/context-coloring.git
-```
-
-- Add the following to your `~/.emacs` file:
-
-```lisp
-(add-to-list 'load-path "~/.emacs.d/context-coloring")
-(require 'context-coloring)
-(add-hook 'js-mode-hook 'context-coloring-mode)
-```
+If there is an abstract syntax tree generator for your language, you can walk
+the syntax tree, find variables and scopes, and build their lengths and levels
+into an array like the one above.
[linter]: https://github.com/jacksonrayhamilton/jslinted
[integration]: https://github.com/jacksonrayhamilton/jslinted#emacs-integration
[point]: http://www.gnu.org/software/emacs/manual/html_node/elisp/Point.html
+[js2-mode]: https://github.com/mooz/js2-mode
[node]: http://nodejs.org/download/
[load path]:
https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Libraries.html
- [elpa] master cb0644a 136/271: Cleanup JavaScript tests., (continued)
- [elpa] master cb0644a 136/271: Cleanup JavaScript tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master c1e9226 171/271: Reorganize lib., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9e14226 135/271: Merge branch 'feature/language-generalization' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7473cc9 169/271: Improve documentation and error handling for async tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b468d1c 166/271: Improve block scope test. Rename and document block scope variable., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d411168 175/271: Revert to single var., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4c5f3ab 145/271: Fix first-run bug, passing js2-mode test., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 15bfad7 165/271: Renames., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4d73262 152/271: Speed up local name lookup., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4fee39d 174/271: Remove .jslintrc files., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 903d938 176/271: Update readme.,
Jackson Ray Hamilton <=
- [elpa] master d48e8cc 057/271: Add benchmark., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d157167 258/271: Strip headers. Use make dependencies., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 63e2590 207/271: Merge branch 'develop', Jackson Ray Hamilton, 2015/02/05
- [elpa] master d4ddaa6 160/271: Use edge js2-mode., Jackson Ray Hamilton, 2015/02/05
- [elpa] master ef461da 230/271: Stop maintaining benchmarks in readme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 5e46686 173/271: Remove JS tests and benchmarks. Remove color schemer., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f9c3de8 252/271: Version 3.1.1., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f2b5d79 264/271: Remove unnecessary .elpaignore., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 75f6705 251/271: Fix on Windows., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 8665ff3 233/271: Simplify `context-coloring-set-colors'., Jackson Ray Hamilton, 2015/02/05