summaryrefslogtreecommitdiff
path: root/haunt.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2018-03-10 20:31:12 -0500
committerDavid Thompson <dthompson2@worcester.edu>2018-03-10 20:32:32 -0500
commit2f222c9f3cf3195805fcc1f70d63d4f6e6c3b4b6 (patch)
tree08a550d882838192f10fe9064b8a17cbfab43261 /haunt.scm
parent6566d9bf84efb9733638e2ca8f95b239ba19f4bd (diff)
Add page for guile-syntax-highlight project.
Diffstat (limited to 'haunt.scm')
-rw-r--r--haunt.scm44
1 files changed, 43 insertions, 1 deletions
diff --git a/haunt.scm b/haunt.scm
index 5e17276..a36b50e 100644
--- a/haunt.scm
+++ b/haunt.scm
@@ -311,8 +311,10 @@ at "
`((h1 "Projects")
(p ,(anchor "Chickadee" "projects/chickadee.html")
" — Game development toolkit for Guile Scheme")
- (p ,(anchor "Guile-SDL2" "projects/guile-sdl2.html")
+ (p ,(anchor "guile-SDL2" "projects/guile-sdl2.html")
" — SDL2 bindings for Guile Scheme")
+ (p ,(anchor "guile-syntax-highlight" "projects/guile-syntax-highlight.html")
+ " — Syntax highlighting library for Guile Scheme")
(p ,(anchor "Haunt" "https://haunt.dthompson.us")
" — Functional, hackable static site generator")
(p ,(anchor "Shroud" "projects/shroud.html")
@@ -416,6 +418,45 @@ following modules:")
("0.1.1" ,(date 2016 01 01))
("0.1.0" ,(date 2015 12 22)))))
+(define guile-syntax-highlight-page
+ (project-page
+ #:name "guile-syntax-highlight"
+ #:file-name "guile-syntax-highlight.html"
+ #:repo "guile-syntax-highlight"
+ #:description
+ `((p "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
+ (highlight-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)
+")
+ #:requirements '("GNU Guile >= 2.0"
+ "GNU Make"
+ "GNU pkg-config")
+ #:license "GNU LGPLv3+"
+ #:releases
+ `(("0.1.0" ,(date 2018 03 10)))))
+
(define chickadee-page
(project-page
#:name "Chickadee"
@@ -570,6 +611,7 @@ Convert SubRip formatted subtitles to WebVTT format.
chickadee-page
sly-page
guile-sdl2-page
+ guile-syntax-highlight-page
shroud-page
srt2vtt-page
(static-directory "js")