add x-source-pkg
to HTML output
This commit is contained in:
parent
a8024d16ed
commit
6556e9f92a
|
@ -1587,12 +1587,14 @@ other documents can link to the section.
|
||||||
|
|
||||||
More specifically, the section title is given the HTML attributes
|
More specifically, the section title is given the HTML attributes
|
||||||
@tt{x-source-module} and @tt{x-part-tag}, plus @tt{x-part-prefixes}
|
@tt{x-source-module} and @tt{x-part-tag}, plus @tt{x-part-prefixes}
|
||||||
if the section or enclosing sections declare tag prefixes. The
|
if the section or enclosing sections declare tag prefixes, and
|
||||||
|
@tt{x-source-pkg} if the source is found within a package at document-build time. The
|
||||||
@racketmodname[scribble/manual] style recognizes those tags to make
|
@racketmodname[scribble/manual] style recognizes those tags to make
|
||||||
clicking a title show cross-reference information.
|
clicking a title show cross-reference information.
|
||||||
|
|
||||||
@history[#:added "1.2"
|
@history[#:added "1.2"
|
||||||
#:changed "1.7" @elem{Added @tt{x-part-prefixes}.}]}
|
#:changed "1.7" @elem{Added @tt{x-part-prefixes}.}
|
||||||
|
#:changed "1.9" @elem{Added @tt{x-source-pkg}.}]}
|
||||||
|
|
||||||
|
|
||||||
@defstruct[html-defaults ([prefix (or/c bytes? path-string?
|
@defstruct[html-defaults ([prefix (or/c bytes? path-string?
|
||||||
|
|
|
@ -22,4 +22,4 @@
|
||||||
|
|
||||||
(define pkg-authors '(mflatt eli))
|
(define pkg-authors '(mflatt eli))
|
||||||
|
|
||||||
(define version "1.8")
|
(define version "1.9")
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
net/base64
|
net/base64
|
||||||
scheme/serialize
|
scheme/serialize
|
||||||
racket/draw/gif
|
racket/draw/gif
|
||||||
|
pkg/path
|
||||||
(prefix-in xml: xml/xml)
|
(prefix-in xml: xml/xml)
|
||||||
(for-syntax scheme/base)
|
(for-syntax scheme/base)
|
||||||
"search.rkt"
|
"search.rkt"
|
||||||
|
@ -312,6 +313,7 @@
|
||||||
root-relative?)
|
root-relative?)
|
||||||
|
|
||||||
(define path-cache (make-hash))
|
(define path-cache (make-hash))
|
||||||
|
(define pkg-cache (make-hash))
|
||||||
|
|
||||||
(define (path->relative p)
|
(define (path->relative p)
|
||||||
(let ([p (path->main-doc-relative p)])
|
(let ([p (path->main-doc-relative p)])
|
||||||
|
@ -1116,6 +1118,14 @@
|
||||||
(cadr t)))])
|
(cadr t)))])
|
||||||
(if (and src taglet)
|
(if (and src taglet)
|
||||||
`([x-source-module ,(format "~s" src)]
|
`([x-source-module ,(format "~s" src)]
|
||||||
|
,@(let* ([path (resolved-module-path-name
|
||||||
|
(module-path-index-resolve
|
||||||
|
(module-path-index-join src #f)))]
|
||||||
|
[pkg (and (path? path)
|
||||||
|
(path->pkg path #:cache pkg-cache))])
|
||||||
|
(if pkg
|
||||||
|
`([x-source-pkg ,pkg])
|
||||||
|
null))
|
||||||
,@(let ([prefixes (current-tag-prefixes)])
|
,@(let ([prefixes (current-tag-prefixes)])
|
||||||
(if (null? prefixes)
|
(if (null? prefixes)
|
||||||
null
|
null
|
||||||
|
|
Loading…
Reference in New Issue
Block a user