diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss
index 2780d33a..38d6c5cc 100644
--- a/collects/scribble/html-render.ss
+++ b/collects/scribble/html-render.ss
@@ -108,6 +108,18 @@
;; ----------------------------------------
+ (define/public (tag->path+anchor ri tag)
+ (let ([dest (resolve-get #f ri tag)])
+ (if dest
+ (values
+ (relative->path (car dest))
+ (if (caddr dest)
+ #f
+ (anchor-name (cadddr dest))))
+ (values #f #f))))
+
+ ;; ----------------------------------------
+
(define/private (reveal-subparts? p)
(part-style? p 'reveal))
diff --git a/collects/setup/scribble-index.ss b/collects/setup/scribble-index.ss
index 4dad3984..cc144a67 100644
--- a/collects/setup/scribble-index.ss
+++ b/collects/setup/scribble-index.ss
@@ -9,11 +9,14 @@
setup/getinfo
setup/dirs
mzlib/serialize
- scheme/path)
+ scheme/path
+ setup/main-collects)
(provide load-xref
xref-render
xref-index
+ xref-binding->definition-tag
+ xref-tag->path+anchor
(struct-out entry))
(define-struct entry (words ; list of strings: main term, sub-term, etc.
@@ -97,3 +100,51 @@
(let ([ri (send renderer resolve (list doc) (list dest-file) ci)])
(send renderer render (list doc) (list dest-file) ri)
(void))))
+
+;; Returns (values