From 2f222c9f3cf3195805fcc1f70d63d4f6e6c3b4b6 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 10 Mar 2018 20:31:12 -0500 Subject: Add page for guile-syntax-highlight project. --- haunt.scm | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) 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") -- cgit v1.2.3