added xref-tag->index-entry
svn: r8038 original commit: 233416bf27603adceef9c1baa884dd5c83056173
This commit is contained in:
parent
fd4de66c02
commit
bb408a644f
|
@ -16,6 +16,7 @@
|
||||||
xref-index
|
xref-index
|
||||||
xref-binding->definition-tag
|
xref-binding->definition-tag
|
||||||
xref-tag->path+anchor
|
xref-tag->path+anchor
|
||||||
|
xref-tag->index-entry
|
||||||
(struct-out entry))
|
(struct-out entry))
|
||||||
|
|
||||||
(define-struct entry (words ; list of strings: main term, sub-term, etc.
|
(define-struct entry (words ; list of strings: main term, sub-term, etc.
|
||||||
|
@ -117,3 +118,18 @@
|
||||||
(let ([renderer (new render%
|
(let ([renderer (new render%
|
||||||
[dest-dir (find-system-path 'temp-dir)])])
|
[dest-dir (find-system-path 'temp-dir)])])
|
||||||
(send renderer tag->path+anchor (xrefs-ri xrefs) tag)))
|
(send renderer tag->path+anchor (xrefs-ri xrefs) tag)))
|
||||||
|
|
||||||
|
(define (xref-tag->index-entry xrefs tag)
|
||||||
|
(let ([v (hash-table-get (collect-info-ext-ht (resolve-info-ci (xrefs-ri xrefs)))
|
||||||
|
`(index-entry ,tag)
|
||||||
|
#f)])
|
||||||
|
(cond
|
||||||
|
[v (make-entry (car v)
|
||||||
|
(cadr v)
|
||||||
|
(cadr tag)
|
||||||
|
(caddr v))]
|
||||||
|
[(and (pair? tag) (eq? 'form (car tag)))
|
||||||
|
;; Try again with 'def:
|
||||||
|
(xref-tag->index-entry xrefs (cons 'def (cdr tag)))]
|
||||||
|
[else #f])))
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,16 @@ The optional @scheme[using-render%] argument is as for
|
||||||
@scheme[load-xref].}
|
@scheme[load-xref].}
|
||||||
|
|
||||||
|
|
||||||
|
@defproc[(xref-tag->index-entry [xref xref?]
|
||||||
|
[tag tag?])
|
||||||
|
(or/c false/c entry?)]{
|
||||||
|
|
||||||
|
Extract an @scheme[entry] structure that provides addition information
|
||||||
|
about the definition (of any) referenced by @scheme[tag]. This
|
||||||
|
function can be composed with @scheme[xref-binding->definition-tag] to
|
||||||
|
obtain information about a binding, such as the library that exports
|
||||||
|
the binding and its original name.}
|
||||||
|
|
||||||
|
|
||||||
@defproc[(xref-render [xref xref?]
|
@defproc[(xref-render [xref xref?]
|
||||||
[doc part?]
|
[doc part?]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user