diff options
author | David Thompson <dthompson2@worcester.edu> | 2015-10-17 23:11:39 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2015-10-17 23:11:39 -0400 |
commit | bc5e6269693ad400c17d5dcd21d60d5f03149ab9 (patch) | |
tree | 80d9e79e23193e9441227b16aa93ca284b75762a /README |
First commit!
Diffstat (limited to 'README')
-rw-r--r-- | README | 66 |
1 files changed, 66 insertions, 0 deletions
@@ -0,0 +1,66 @@ +-*- mode: org -*- + +Guile-syntax-highlight is a general-purpose syntax highlighting +library for GNU Guile. It can parse code written in various +programming languages into a simple s-expression that can be easily +converted to HTML (via SXML) or any other format for rendering. + +* Example + + #+BEGIN_SRC scheme + (use-modules (syntax-highlight) + (syntax-highlight scheme) + (sxml simple)) + + (define code + "(define (square x) \"Return the square of X.\" (* x x))") + + ;; Get raw highlights list. + (define highlighted-code + (highlight scheme-highlighter code)) + + ;; Convert to SXML. + (define highlighted-sxml + (highlights->sxml highlighted-code)) + + ;; Write HTML to stdout. + (display (sxml->xml highlighted-sxml)) + (newline) + #+END_SRC + +* Requirements + + - GNU Guile >= 2.0.9 + +* Building + + Guile-syntax-highlight uses the familiar GNU build system and + requires GNU Make to build. + +** From tarball + + After extracting the tarball, run: + + #+BEGIN_SRC sh + ./configure + make + make install + #+END_SRC + +** From Git + + In addition to GNU Make, building from Git requires GNU Automake + and Autoconf. + + #+BEGIN_SRC sh + git clone git@dthompson.us:guile-syntax-highlight.git + cd guile-syntax-highlight + ./bootstrap + ./configure + make + make install + #+END_SRC + +* License + + LGPLv3 or later. See =COPYING= for the full license text. |