I have two simple scribble files. The first one simply includes the second:



#lang scribble/manual
@title{test-tag-prefix}
@include-section{sub.scrbl}



And the second one uses #:tag-prefix, and inserts an @elemref in the TOC:



#lang scribble/manual
@title[#:tag-prefix '(lib "test-tag-prefix/scribblings/sub.scrbl")]{sub}
@(require scribble/struct)
@(make-toc-element #f
                   (list (elemtag '(prefixable "foo") "foo-tag"))
                   (list (elemref '(prefixable "foo") "foo-ref-in-toc")))
@(elemref '(prefixable "foo") "foo-ref-in-part")



The @elemref within the document works fine, but the @elemref in the Table Of 
Contents is shown in red and is not a hyperlink, see the attached screenshot.

If I remove the #:tag-prefix, everything works fine. Also, the second file on 
its own works fine (but it ignores the #:tag-prefix). I tried creating the 
appropriate taglet:



(elemref '(prefixable "(lib test-tag-prefix/scribblings/test-tag-prefix.scrbl)"
                      "(lib test-tag-prefix/scribblings/sub.scrbl)"
                      "foo")
         "foo-ref-in-toc")



but elemref rejects it (I think the contract on elemref is wrong, it should 
accept a taglet, not a tag). Directly calling make-link-element worked, though:



(make-link-element
 #f
 (decode-content (list "foo-ref-in-toc"))
 `(elem (prefixable "(lib test-tag-prefix/scribblings/test-tag-prefix.scrbl)"
                    "(lib test-tag-prefix/scribblings/sub.scrbl)"
                    "foo")))



Is there a better way to automatically generate this tag? I can store the 
document tags within a global variable and cons them everywhere I'm inserting 
an @elemref in the Table Of Contents, but it seems a bit of a hack.

Thanks,
Georges

----------

For experimentation, I uploaded a minimal package containing the two files at 
https://github.com/jsmaniac/test-tag-prefix/tree/master/scribblings and the 
package can be installed using:

raco pkg install https://github.com/jsmaniac/test-tag-prefix.git

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to