Use 'scribble-render-as syntax property, to render correctly multi-like #λ forms.

This commit is contained in:
Georges Dupéron 2017-02-05 23:30:35 +01:00
parent 1c7d513cf4
commit 25731ec47e
2 changed files with 15 additions and 7 deletions

View File

@ -165,7 +165,7 @@
(lambda args
(define-syntax % (make-rename-transformer #'%1))
body))
'scribble-render
'scribble-render-as
aful-scribble-render)
))
stx)))

View File

@ -1,11 +1,19 @@
#lang racket
(provide aful-scribble-render)
(define (aful-scribble-render self)
(require scribble/manual
phc-toolkit/stx)
(define (aful-scribble-render self id code typeset-code uncode d->s stx-prop)
(syntax-case self ()
[(_ _ _ body)
#`(let ()
(local-require scribble-enhanced/with-manual)
(elem (list (seclink "_lang_aful" #:doc '(lib "aful/docs/aful.scrbl")
(tt ""))
(racket body))))]))
; #λ(body) reads as:
; (lambda args
; (define-syntax % (make-rename-transformer #'%1))
; body)
(with-syntax ([uncode (datum->syntax uncode (syntax-e uncode) self)])
(syntax/top-loc self
((uncode(seclink "_lang_aful"
#:doc '(lib "aful/docs/aful.scrbl")
(tt "")))
body)))]))