/usr/bin/scm2html is in scheme9 2010.11.13-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | #! /usr/bin/s9 -f
; scm2html -- print Scheme code to HTML
; By Nils M Holm, 2009,2010
; See the LICENSE file of the S9fES package for terms of use
;
; Usage: scm2html [-9dsx] [file ...]
;
; Render Scheme code contained in the given file. When no file
; is given render stdin. Write output to stdout.
;
; Options:
;
; -9 highlight S9fES (non-R4RS) procedures
; -d write a full HTML document (default: PRE block only)
; -s enable CSS-based syntax highlighting
; -x highlight S9fES extension procedures
; -L emit Lout output instead of HTML
;
; The CSS2 style sheet "scheme.css" contains the default style for
; syntax and expression highlighting.
;
; NOTE: This program handles only a subset of R4RS Scheme correctly.
; Caveat utilitor!
(load-from-library "scm2html.scm")
(load-from-library "parse-optionsb.scm")
(define show-help (option #\h #f))
(define show-matches (option #\s #f))
(define full-html (option #\d #f))
(define mark-s9-procs (option #\9 #f))
(define mark-s9-extns (option #\x #f))
(define lout-mode (option #\L #f))
(define options `(,show-matches
,full-html
,mark-s9-procs
,mark-s9-extns
,show-help
,lout-mode))
(define (usage)
(display "Usage: scm2html [-9dsxL] [file ...]")
(newline))
(let ((files (parse-options! (sys:command-line) options usage)))
(cond ((opt-val show-help)
(display-usage
`(""
,usage
""
"Render Scheme code in HTML"
""
"-9 highlight S9fES (non-R4RS) procedures"
"-d write full HTML document (default: PRE block only)"
"-s enable CSS-based syntax highlighting"
"-x highlight S9fES extension procedures"
"-L emit Lout output instead of HTML"
""))
(sys:exit 0))
((null? files)
(scm2html 'full-html: (opt-val full-html)
'show-matches: (opt-val show-matches)
'mark-s9-procs: (opt-val mark-s9-procs)
'mark-s9-extns: (opt-val mark-s9-extns)
'lout-mode: (opt-val lout-mode)))
(else
(for-each (lambda (file)
(with-input-from-file
file
(lambda ()
(scm2html 'full-html: (opt-val full-html)
'show-matches: (opt-val show-matches)
'mark-s9-procs: (opt-val mark-s9-procs)
'mark-s9-extns: (opt-val mark-s9-extns)
'lout-mode: (opt-val lout-mode)))))
files))))
|