Skip to content

Instantly share code, notes, and snippets.

@gcr
Created May 30, 2012 02:17
Show Gist options
  • Select an option

  • Save gcr/2832883 to your computer and use it in GitHub Desktop.

Select an option

Save gcr/2832883 to your computer and use it in GitHub Desktop.

Scribbled planet documentation has broken links.

To see this,

  1. Copy info.rkt and test.scrbl to a folder
  2. Run raco planet link yourname foldername.plt 1 0 /path/to/here
  3. Run raco planet create .
  4. Open up planet-docs/index.html
  5. Click on the helpfully provided link.
  6. The link's href is /#(part._testing-section-tag)

This is because in scribble/html-render.rkt in the render-content method near line 1084:

    (define/override (render-content e part ri)
        ... many lines ...
        [(and (link-element? e) (not (current-no-links)))
         (parameterize ([current-no-links #t])
           (let-values ([(dest ext?)
                         (resolve-get/ext? part ri (link-element-tag e))])
         ...

It turns out (dest-path dest) is a #<mobile-root> containing the output folder of the planet package (in my case, #<path:planet-docs/test>). Then, (dest->url dest) returns the incorrect href, "/#(part._testing-section-tag)" because it expects a file instead of a directory (see line 383 of html-render.rkt).

#lang setup/infotab
(define scribblings '(("test.scrbl" ())))
;; don't care
(define name "don't care")
(define blurb '("don't care"))
(define release-notes '((p "don't care")))
(define category 'misc)
(define primary-file "info.rkt")
(define repositories '("4.x"))
#lang scribble/doc
@(require scribble/manual planet/scribble)
@title{Testing}
@section[#:tag "testing-section-tag"]{Some tag}
@seclink["testing-section-tag"]{Try clicking me!}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment