[racket] How to disable cross-referencing in Scribble; why inside

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Jan 8 18:05:49 EST 2013

At Tue, 8 Jan 2013 14:04:33 -0600, Grant Rettke wrote:
> I want to use Scribble for documenting some non-Racket code and will
> use the eval environment (yet to be done) along with it's nice
> rendering and display.
> 
> I don't want scribble attempt to cross reference the language since it
> will not be do-able and red-lines will appear all over.
> 
> How do I disable that cross-referencing in a case like this?

If you refrain from importing `for-label', then nothing will get
hyperlinked, because there will be no `for-label' bindings to direct
the link.

If you want the same file to have some other code that is hyperlinked,
then you can arrange for the code that you don't want linked to have an
empty lexical context. The `strip-context' function can remove lexical
context. See the example below.

----------------------------------------

#lang scribble/manual
@(require (for-syntax racket/base
                      syntax/strip-context)
          (for-label racket/base))

Hyperlinked:

@racketblock[(cons car cdr)]

Not hyperlinked:

@(define-syntax (xracketblock stx)
   (syntax-case stx ()
     [(_ . content)
       #`(racketblock . #,(strip-context #'content))]))

@xracketblock[(cons car cdr)]


Posted on the users mailing list.