hyper-literate/collects/scribble/doc/reader.ss
Eli Barzilay 91eee31910 read-inside-syntax -> read-syntax-inside
svn: r8912

original commit: b866eeb5579bba3399931eed36e9ead8771a832d
2008-03-07 02:27:09 +00:00

25 lines
744 B
Scheme

(module reader 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)))))