Permalink
Browse files

Readme and license

  • Loading branch information...
1 parent 9096512 commit e446f160a4e23f6e192b23516d103fa5db4ea5c6 @trishume committed Jun 8, 2016
Showing with 38 additions and 13 deletions.
  1. +21 −0 LICENSE.txt
  2. +17 −13 Readme.md
View
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2016 Tristan Hume
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
View
@@ -1,11 +1,18 @@
# syntect
-`syntect` is a work-in-progress syntax highlighting library for Rust that uses [Sublime Text syntax definitions](http://www.sublimetext.com/docs/3/syntax.html#include-syntax). It is far from complete but eventually the goal is for it to be used in code analysis tools and text editors.
+`syntect` is a work-in-progress syntax highlighting library for Rust that uses [Sublime Text syntax definitions](http://www.sublimetext.com/docs/3/syntax.html#include-syntax). It is not quite complete but eventually the goal is for it to be used in code analysis tools and text editors.
If you are writing a text editor (or something else needing highlighting) in Rust and this library doesn't fit your needs, I consider that a bug and you should file an issue or email me.
It is currently mostly complete and can parse, interpret and highlight based on Sublime Text syntax and `tmTheme` files.
+## Goals
+
+- Work with many languages (accomplished through using existing grammar formats)
+- Be super fast
+- API that is both easy to use, and allows use in fancy text editors with piece tables and incremental re-highlighting and the like
+- High quality highlighting, supporting things like heredocs and complex syntaxes (like Rust's).
+
## Screenshots
There's currently an example program called `syncat` that prints one of the source files using hard-coded themes and syntaxes using 24-bit terminal escape sequences supported by many newer terminals. These screenshots don't look as good as they could for two reasons: first the sRGB colours aren't corrected properly, and second the Rust syntax definition uses some fancy labels that these themes don't have highlighting for.
@@ -14,23 +21,20 @@ There's currently an example program called `syncat` that prints one of the sour
![Base 16 Ocean Dark](http://i.imgur.com/CwiPOwZ.png)
![Solarized Light](http://i.imgur.com/l3zcO4J.png)
-## Goals
-
-- Work with many languages (accomplished through using existing grammar formats)
-- Be super fast
-- API that is both easy to use, and allows use in fancy text editors with piece tables and incremental re-highlighting and the like
-- High quality highlighting, supporting things like heredocs and complex syntaxes (like Rust's).
-
## Roadmap
- [x] Sketch out representation of a Sublime Text syntax
- [x] Parse `.sublime-syntax` files into the representation.
- [x] Write an interpreter for the `.sublime-syntax` state machine that highlights an incoming iterator of file lines into an iterator of scope-annotated text.
- [x] Parse TextMate/Sublime Text theme files
- [x] Highlight a scope-annotated iterator into a colour-annotated iterator for display.
-- [ ] Make the API nicer to use
-- [ ] Add good demo programs
-- [ ] Document the API
-- [ ] Add sRGB colour correction
-- [ ] Make it really fast
+- [ ] Add nice API wrappers for simple use cases. The base APIs are designed for deep high performance integration with arbitrary text editor data structures.
+- [ ] Make syncat a better demo, and maybe more demo programs
+- [ ] Document the API better and make things private that don't need to be public
+- [ ] Add sRGB colour correction (not sure if this is necessary, could be the job of the text editor)
+- [ ] Make it really fast (mosty two hot-paths need caching, same places Textmate 2 caches)
- [ ] Add C bindings so it can be used as a C library from other languages.
+
+## License and Acknowledgements
+
+Thanks to [Textmate 2](https://github.com/textmate/textmate) and @defuz's [sublimate](https://github.com/defuz/sublimate) for the existing open source code I used as inspiration and in the case of sublimate's `tmTheme` loader, copy-pasted. All code (including defuz's sublimate code) is released under the MIT license.

0 comments on commit e446f16

Please sign in to comment.