Functions not being linked in scribble

23 views
Skip to first unread message

David Storrs

unread,
Apr 28, 2020, 10:12:46 AM4/28/20
to Racket Users
According to what I see in Scribble, both actual examples and in the documentation, I had thought that if I did @defproc[func-name] then func-name would become a link target and later uses of @racket[func-name] would automatically link to that site.  I'm clearly missing something; my functions are being rendered in link style but they have red links under them and are not actually links.  Can someone point me in the right direction?

Ben Greenman

unread,
Apr 28, 2020, 11:00:01 AM4/28/20
to Racket Users
Did you (require (for-label .... func-name)) ?

David Storrs

unread,
Apr 28, 2020, 11:32:36 AM4/28/20
to Ben Greenman, Racket Users
Here's my test code.  I get the test.html file out at the end and, as expected, the explanation of bar says "Calls foo" with foo in blue with a red line underneath.  What am I missing?


; test.rkt
#lang racket
(provide (all-defined-out))
(define (foo) 7)
(define (bar) (foo))

----------

; test.scrbl
#lang scribble/manual
@(require (for-label racket "test.rkt"))
@title{My Library}
@defproc[(foo) any]{Returns 7}
@defproc[(bar) any]{Calls @racket[foo]}

----------

; command line

$ racket
Welcome to Racket v7.6.
> (require "test.rkt")
> (bar)
7


$ scribble test.scrbl

Output:
test.scrbl:6:10: WARNING: no declared exporting libraries for definition
  in: foo
test.scrbl:8:10: WARNING: no declared exporting libraries for definition
  in: bar
 [Output to test.html]
Warning: some cross references may be broken due to undefined tags:
 (dep (#<path:/Users/dstorrs/projects/handy/scribblings/test.rkt> bar))
 (dep ((lib "racket/contract/base.rkt") any))
 (dep ((lib "racket/contract.rkt") any))
 (dep ((lib "racket/contract/private/misc.rkt") any))
 (dep (#<path:/Users/dstorrs/projects/handy/scribblings/test.rkt> foo))
 (dep ((lib "racket/main.rkt") any))


--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAFUu9R5%3Dk-WHJ87FHFbLFj-XWy9%2BhMrsVGXcGfeA834s25EfVg%40mail.gmail.com.

Sam Tobin-Hochstadt

unread,
Apr 28, 2020, 11:41:04 AM4/28/20
to David Storrs, Ben Greenman, Racket Users
I believe you're missing a `defmodule` inside test.scrbl.

Sam
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAE8gKodfM9TON5T7hwjQ6XPUCKGHdv98Rx-cX%2BFDo6ALXLg36A%40mail.gmail.com.

David Storrs

unread,
Apr 28, 2020, 12:46:39 PM4/28/20
to Racket Users
On Tue, Apr 28, 2020 at 11:41 AM Sam Tobin-Hochstadt <sa...@cs.indiana.edu> wrote:
I believe you're missing a `defmodule` inside test.scrbl.

Aha.  Okay, I:

*) Added @defmodule[test] to the test.scrbl file
*) Created a main.rkt that did (require "test.rkt") and (provide (all-from-out "test.rkt"))
*) Did a raco pkg install to ensure that test was a recognized collection. 
*) scribble test.scrbl

At that point it works correctly.   Thank you!
Reply all
Reply to author
Forward
0 new messages