[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1ceb460 139/271: Documentation.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 1ceb460 139/271: Documentation. |
Date: |
Thu, 05 Feb 2015 18:30:35 +0000 |
branch: master
commit 1ceb4600f0eda8d5b85076abe22ebb31d4eb6d2a
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Documentation.
---
README.md | 48 +++++++++++++++++++++++++++++++++++++++---------
scopifier-example.png | Bin 0 -> 2516 bytes
2 files changed, 39 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 2d950f4..4a380be 100644
--- a/README.md
+++ b/README.md
@@ -31,16 +31,48 @@ code*.
## Features
- Supported languages: JavaScript
-- Light and dark color schemes.
+- Light and dark (customizable) color schemes.
- Fast async AST parsing. Some total parse + recolor times:
- jQuery (9191 lines): 0.63 seconds
- Lodash (6786 lines): 0.37 seconds
- Async (1124 lines): 0.17 seconds
- mkdirp (98 lines): 0.09 seconds
-- Extensible. Just write a scopifier for the language of your choice and add an
- entry to `context-coloring-scopifier-plist`.
-- Customizable. If you don't like the color schemes, or you want them to match
- your favorite theme, just `M-x customize` and search for "context-coloring".
+
+## Extending
+
+It would be great if this package supported more languages. I welcome any pull
+request that adds new language support.
+
+Extension is relatively straightforward. Write a "scopifier" for the language
of
+your choice, add an entry to `context-coloring-scopifier-plist`, and the plugin
+should handle the rest.
+
+A "scopifier" is a CLI program that reads a buffer's contents from stdin, and
+then writes a JSON array of integers to stdout. Every three numbers in the
array
+represent a range of color. For instance, if I fed the following string of
+JavaScript code to a scopifier,
+
+```js
+var a = function () {};
+```
+
+then the scopifier would produce the following array:
+
+```js
+[
+ 1, 24, 0,
+ 9, 23, 1
+]
+```
+
+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:
+
+<p align="center">
+ <img alt="Screenshot of ranges [1, 24) and [9, 23)."
src="scopifier-example.png" title="Screenshot">
+</p>
## Usage
@@ -55,10 +87,7 @@ cd ~/.emacs.d/
git clone https://github.com/jacksonrayhamilton/context-coloring.git
```
-- Add it to your [load path][].
-- Add a mode hook for `context-coloring-mode`.
-
-In your `~/.emacs` file:
+- Add the following to your `~/.emacs` file:
```lisp
(add-to-list 'load-path "~/.emacs.d/context-coloring")
@@ -68,5 +97,6 @@ In your `~/.emacs` file:
[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
[node]: http://nodejs.org/download/
[load path]:
https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Libraries.html
diff --git a/scopifier-example.png b/scopifier-example.png
new file mode 100644
index 0000000..1d690cb
Binary files /dev/null and b/scopifier-example.png differ
- [elpa] master 146c096 114/271: Merge branch 'develop' into feature/color-schemer, (continued)
- [elpa] master 146c096 114/271: Merge branch 'develop' into feature/color-schemer, Jackson Ray Hamilton, 2015/02/05
- [elpa] master aa5cca3 129/271: Multiple vars. Rename., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fae85f9 117/271: Add code samples., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b190309 133/271: Update documentation to be language-agnostic., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 6f34a6a 134/271: Update screenshot., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 5a7fc32 138/271: Documentation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f77870d 137/271: Add language support documentation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master faea355 123/271: Cleanup and improve tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4b2e1db 140/271: Documentation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 3f1bae9 142/271: Make js2-mode read-only., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 1ceb460 139/271: Documentation.,
Jackson Ray Hamilton <=
- [elpa] master 1b7e0a5 122/271: Make context-coloring-face-count customizable. Add some dummy faces., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 459987e 131/271: Generalize for different major modes. Remove dirty benchmarking., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 2341708 132/271: Reorganize JavaScript files., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4be9ec8 147/271: Documentation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 16cee40 150/271: Pass test for block scopes., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f7b5d33 143/271: Add skeletal support for js2-mode scopification., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 549e523 149/271: Add failing test for block scopes., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9f87a03 148/271: Actually colorize complex files., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 76122df 144/271: Write js2 scopifier., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 5fcd757 146/271: Refactor to use more resilient dispatch strategy., Jackson Ray Hamilton, 2015/02/05