[racket] Scribble question

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Jul 2 19:03:47 EDT 2010

Are you running `scribble' through the command line?

If so, add `++xref-in setup/xref load-collections-xref' to the command:

  scribble ++xref-in setup/xref load-collections-xref doc.scrbl

That means "load all the cross-reference information for installed
documents", so that Scribble knows where to point the link for `map'.

The "Scribble HTML" button in DrRacket adds that automatically. If
you're already using DrRacket or it doesn't work on the command line,
maybe there's a problem with the doc installation?


Eventually, you'll probably want those links to go to some other web
site, instead of the docs installed on the machine where you run
Scribble. In that case, you'll want to add something like

  --redirect-main http://docs.racket-lang.org/

to the command line. The `--redirect-main' flag generates links to go
through "docs.racket-lang.org" instead of your local copy (under the
assumption that the pages at "docs.racket-lang.org" have the same HTML
page and anchor names as your installation, which is usually an ok
assumption, since Scribble is designed to generate them consistently).

At Fri, 2 Jul 2010 18:42:36 -0400 (EDT), Hari Prashanth wrote:
> 
> What am I missing? racket-map renders a red link...  
> 
> #lang scribble/manual
> @(defmodule "vlist.ss")
> 
> @(require (for-label "vlist.ss")
>           "doc-helper.rkt")
> 
> @defproc[(map ...) ...]{
> Function @scheme[map] is similar to @|racket-map| for lists. }
> 
> 
> ;; doc-helper.rkt
> 
> #lang at-exp racket/base
> (require scribble/manual
>          (for-label racket/base))
> 
> (define racket-map @racket[map])
> (provide racket-map)
> 
> 
> 
> ----- Original Message -----
> From: "Matthew Flatt" <mflatt at cs.utah.edu>
> To: "Hari Prashanth" <krhari at ccs.neu.edu>
> Cc: "plt-scheme" <users at lists.racket-lang.org>
> Sent: Wednesday, June 30, 2010 5:02:46 PM GMT -05:00 US/Canada Eastern
> Subject: Re: [racket] Scribble question
> 
> At Wed, 30 Jun 2010 15:21:19 -0400 (EDT), Hari Prashanth wrote:
> > I have a function by name map. For its documentation, I have
> > something like
> > 
> > @defproc[(map ...) (...)]{
> > @scheme[map] is similar to @scheme[map]
> > }
> > 
> > The want the latter @scheme[map] to refer map provided by lists.
> > 
> > How can I do that? Can someone help me out with this?
> 
> The simplest solution is to create a new module:
> 
>  ;; other.rkt:
>  #lang at-exp racket/base
>  (require scribble/manual
>           (for-label racket/base))
> 
>  (define racket-map @racket[map])
>  (provide racket-map)
> 
> And use it like this:
> 
>  #lang scribble/manual
>  @(require (for-label lang/htdp-intermediate)
>            "other.rkt")
> 
>  The ISL @racket[map] is similar to Racket's @|racket-map|.
> 
> If you want everything in one module, you can play a trick with
> macro-introduced imports:
> 
>  #lang scribble/manual
>  @(require (for-label lang/htdp-intermediate))
> 
>  @(begin
>    (define-syntax-rule (def racket-map)
>      (begin
>        (require (for-label racket/base))
>        (define racket-map @racket[map])))
>    (def racket-map))
> 
>  The ISL @racket[map] is similar to Racket's @|racket-map|.
> 
> There should be a better way to do this --- maybe a macro that packages
> up the macro-introduced-import trick.


Posted on the users mailing list.