hyper-literate/collects/scribble/doc/reader.ss
Eli Barzilay bc13980309 use some #lang lines
svn: r9173

original commit: 1a5cb7ed64be900f5f5073c5dc7429aaf232a656
2008-04-06 20:59:28 +00:00

23 lines
725 B
Scheme

#lang scheme/base
(require (prefix-in scribble: "../reader.ss"))
(provide (rename-out [*read read])
(rename-out [*read-syntax read-syntax]))
(define (*read [inp (current-input-port)])
(wrap inp (scribble:read-inside inp)))
(define (*read-syntax [src #f] [port (current-input-port)])
(wrap port (scribble:read-syntax-inside src port)))
(define (wrap port body)
(let* ([p-name (object-name port)]
[name (if (path? p-name)
(let-values ([(base name dir?) (split-path p-name)])
(string->symbol (path->string (path-replace-suffix name #""))))
'page)]
[id 'doc])
`(module ,name scribble/doclang
(#%module-begin ,id () . ,body))))