Merge pull request #3 from kflu/master

remove unused tool
pull/5/head
Kefei Lu 2018-04-02 11:19:11 -07:00 committed by GitHub
commit a769f5b0e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 52 deletions

View File

@ -101,13 +101,12 @@ straightfoward: simply run `msbuild` in `src/`, or use your favorite IDE.
The project structure looks like so:
├───doc
├───src
│ ├───schemy // the core schemy interpreter (schemy.dll)
│ ├───examples
│ │ ├───command_server // loading command handlers from schemy scripts
│ │ └───repl // an interactive interpreter (REPL)
│ └───test
└───tools
└───src
├───schemy // the core schemy interpreter (schemy.dll)
├───examples
│ ├───command_server // loading command handlers from schemy scripts
│ └───repl // an interactive interpreter (REPL)
└───test
## Embedding and Extending Schemy

View File

@ -1,45 +0,0 @@
#|
This script evaluates a script file to transform input file content. The transformed output
is displayed to stdout.
This is currently broken because racket IO APIs doesn't strip BOM at the beginning of the file
|#
#lang at-exp racket
(require web-server/templates
racket/cmdline)
(define template-file (make-parameter ""))
(define input-file (make-parameter ""))
(command-line
#:once-each
[("-t" "--template") template
"template file to use. `FILENAME` and `INPUT` variables are available to the template"
(template-file template)]
#:args (input)
(input-file input))
#|
(define (read-content fn)
(define lines (port->lines (open-input-file #:mode 'text (input-file))))
(string-join lines "\n"))
|#
(define (read-content fn)
(port->string (open-input-file fn))
)
(define INPUT (read-content (input-file)))
(define FILENAME (path->string (file-name-from-path (input-file))))
(define ns (make-base-namespace))
(namespace-set-variable-value! 'INPUT INPUT #f ns)
(namespace-set-variable-value! 'FILENAME FILENAME #f ns)
(void
(write-string
(eval
(read
(open-input-file (template-file))) ns)))