guile-syntax-highlight

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.

Usage

(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)

Releases

Requirements

Installation

guile-syntax-highlight uses the standard GNU build system. To build and install guile-syntax-highlight from source, run:

./configure
make
make install

License

GNU LGPLv3+

Source Code

guile-syntax-highlight is developed using the Git version control system. The official repository is hosted at https://git.dthompson.us/guile-syntax-highlight.git

Anonymous clone

git clone https://git.dthompson.us/guile-syntax-highlight.git

Community

Real-time discussion for guile-syntax-highlight can be found on the #guile channel on the Freenode IRC network.

Contributing

Send patches and bug reports to davet@gnu.org.