commit 95400be0e5f426d982ea2801c9ec166729e3607f
parent 916c17231783684972c869cf40ce43e648ba14bf
Author: Suzanne Soy <ligo@suzanne.soy>
Date: Tue, 6 Jul 2021 02:42:24 +0100
Merge tag 'v7.2' into my-changes-rebased
Diffstat:
9 files changed, 85 insertions(+), 19 deletions(-)
diff --git a/scribble-doc/scribblings/scribble/acmart.scrbl b/scribble-doc/scribblings/scribble/acmart.scrbl
@@ -161,13 +161,22 @@ Specifies a subtitle.}
#f)
#f]
[#:email email
- (or/c pre-content? (listof pre-content?) #f)
- #f]
+ (or/c pre-content? email? (listof email?))
+ '()]
[name pre-content?] ...)
block?]{
Specifies an author with an optional email address, affiliation, and/or orcid.
+@codeblock|{
+ #lang scribble/acmart
+ @title{Title}
+ @author["Unboxed Value"
+ #:email (list (email "user@server.com")
+ (email-string "case--Int#@GHC.Prim.info"))]}
+
+ @abstract{abstracting abstract title}
+}|
}
@deftogether[(
@@ -197,9 +206,18 @@ screen version of the image links to the badge authority.
}
-@defproc[(email [text pre-content?] ...)
- email?]{
+@deftogether[(
+@defproc[(email [text pre-content?] ...) email?]
+@defproc[(email-string [text string?] ...) email?]
+)]{
Creates an @racket[email?] object for use with @racket[author].
+
+ @racket[email-string] is like @racket[email]
+ except that @racket[email-string] only takes
+ @tech[#:doc '(lib "scribblings/reference/reference.scrbl") #:key "string"]{strings},
+ escapes all @tt{%} and @tt{#} characters
+ in the arguments and typesets the email address with the
+ @racket['exact-chars] style.
}
@defproc[(email? [email any/c]) boolean?]{
diff --git a/scribble-doc/scribblings/scribble/base.scrbl b/scribble-doc/scribblings/scribble/base.scrbl
@@ -737,7 +737,7 @@ which is normally defined using @racket[elemtag].}
Creates an index element given a plain-text string---or list of
strings for a hierarchy, such as @racket['("strings" "plain")] for a
``plain'' entry below a more general ``strings'' entry. As index keys,
-the strings are ``cleaned'' using @racket[clean-up-index-strings]. The
+the strings are ``cleaned'' using @racket[clean-up-index-string]. The
strings (without clean-up) also serve as the text to render in the
index. The @tech{decode}d @racket[pre-content] is the text to appear
inline as the index target.
diff --git a/scribble-doc/scribblings/scribble/how-to-paper.scrbl b/scribble-doc/scribblings/scribble/how-to-paper.scrbl
@@ -399,7 +399,7 @@ What if you want to provide arguments in text mode, but you also want
to supply other optional arguments? You can use both
@litchar{[}...@litchar{]} and @litchar["{"]...@litchar["}"] for an
operation, as long as the @litchar{[}...@litchar{]} is first, and as
-long as no character separate the closing @litchar{]} from the
+long as no characters separate the closing @litchar{]} from the
opening @litchar["{"]. For example, calling @racket[italic] is the
same as using @racket[elem] with the @racket['italic] style:
@@ -491,7 +491,7 @@ label), then the string is typically provided through
Sometimes, both @litchar{[}...@litchar{]} and
@litchar["{"]...@litchar["}"] are used, where the former surround
Racket arguments that precede text to typeset. Finally, if a form is a
-purely Racket-level form with not typeset result, such as a
+purely Racket-level form with no typeset result, such as a
@racket[require] to import more operations, then typically just
@litchar["@"] is used.
@@ -679,4 +679,4 @@ need more power.
If you are interested in text generation and preprocessing, continue
with @secref["reader"], but then switch to
-@other-doc['(lib "scribblings/scribble/scribble-pp.scrbl")].
-\ No newline at end of file
+@other-doc['(lib "scribblings/scribble/scribble-pp.scrbl")].
diff --git a/scribble-doc/scribblings/scribble/how-to.scrbl b/scribble-doc/scribblings/scribble/how-to.scrbl
@@ -175,7 +175,7 @@ The following example illustrates section hyperlinks:
Since the page is so short, the hyperlinks in the above example are
more effective if you change the @filepath{info.rkt} file to add the
- @racket['multi-file] flag:
+ @racket['multi-page] flag:
@racketblock[
(define scribblings '(("manual.scrbl" (multi-page))))
diff --git a/scribble-doc/scribblings/scribble/renderer.scrbl b/scribble-doc/scribblings/scribble/renderer.scrbl
@@ -3,7 +3,8 @@
"utils.rkt"
(for-label racket/class
scribble/render
- scribble/xref))
+ scribble/xref
+ setup/dirs))
@(define-syntax-rule (defmodule/local lib . content)
(begin
@@ -354,6 +355,7 @@ Configures the renderer to redirect links to external documents via
@racket[url], adding a @tt{tag} query element to the end of the
URL that contains the Base64-encoded, @racket[print]ed, serialized
original tag (in the sense of @racket[link-element]) for the link.
+The result of @racket[get-doc-search-url] is intended for use as @racket[url].
If the link is based on a cross-reference entry that has a
document-identifying string (see @racket[load-xref] and its
diff --git a/scribble-doc/scribblings/scribble/running.scrbl b/scribble-doc/scribblings/scribble/running.scrbl
@@ -148,7 +148,7 @@ information for all installed documentation, and @PFlag{m} or
setup/xref load-collections-xref}.
The @DFlag{redirect-main} flag for HTML output redirects links to the local
-installation's documentation to a given URL, such as
+installation's documentation (not user-scope documentation) to a given URL, such as
@tt{http://docs.racket-lang.org/}. Beware that documentation links
sometimes change (although Scribble generates HTML paths and anchors
in a relatively stable way), so
@@ -156,11 +156,13 @@ in a relatively stable way), so
more reliable when building with an installation for @italic{version}.
The @DFlag{redirect-main} flag is ignored for non-HTML output.
-The @DFlag{redirect} flag is like @DFlag{redirect-main}, except
-that it builds on the given URL to indicate a cross-reference tag that
-is more stable than an HTML path and anchor (in case the documentation
-for a function changes sections, for example). No server currently
-exists to serve such tag requests, however.
+The @DFlag{redirect} flag is like @DFlag{redirect-main}, except that
+it builds on the given URL to indicate a cross-reference tag that is
+more stable than an HTML path and anchor (in case the documentation
+for a function changes sections, for example), and it can generate
+redirected linked for documentation that is installed in user scope.
+The URL @tt{https://docs.racket-lang.org/local-redirect/index.html} can
+work for these redirections.
For cross-references among documentation that is not part of the
Racket installation, use @DFlag{info-out} to save information from a
diff --git a/scribble-lib/scribble/acmart.rkt b/scribble-lib/scribble/acmart.rkt
@@ -3,6 +3,7 @@
(require setup/collects
racket/contract/base
racket/list
+ racket/string
scribble/core
scribble/base
scribble/decode
@@ -43,7 +44,7 @@
affiliation?
(listof affiliation?)
#f)
- #:email (or/c pre-content? email? (listof email?) #f))
+ #:email (or/c pre-content? email? (listof email?)))
#:rest (listof pre-content?)
block?)]
[authorsaddresses (->* ()
@@ -62,6 +63,9 @@
[email (->* ()
#:rest (listof pre-content?)
email?)]
+ [email-string (->* ()
+ #:rest (listof string?)
+ email?)]
[email? (-> any/c boolean?)]
[affiliation (->* ()
(#:position (or/c pre-content? #f)
@@ -367,11 +371,29 @@
(define (email . text)
(author-email text))
+(define (email-string . text)
+ (define text-escaped
+ (for/list ([str (in-list text)])
+ (escape-email-string str)))
+ (author-email
+ (list
+ (make-element
+ (make-style #f '(exact-chars))
+ text-escaped))))
+
(define (convert-email email)
(make-element
(make-style "SAuthorEmail" command-props)
(decode-content (email-text email))))
+(define escape-email-map
+ #(("#" . "\\#")
+ ("%" . "\\%")))
+(define (escape-email-string str)
+ (for/fold ([str str])
+ ([escape-map (in-vector escape-email-map)])
+ (string-replace str (car escape-map) (cdr escape-map))))
+
(define (affiliation #:position [position #f]
#:institution [institution #f]
#:street-address [street-address #f]
diff --git a/scribble-lib/scribble/eval.rkt b/scribble-lib/scribble/eval.rkt
@@ -325,8 +325,25 @@
(when expect
(let ([expect (do-plain-eval ev (car expect) #t)])
(unless (equal? val expect)
- (error 'eval "example result check failed: ~.s" s))))
+ (define result " result: ")
+ (define expected " expected: ")
+ (error 'eval "example result check failed: ~.s\n~a\n~a\n"
+ s
+ (string-append result (to-lines val (string-length result)))
+ (string-append expected (to-lines expect (string-length expected)))))))
render+output)
+
+ (define (to-lines exps blank-space)
+ (define blank (make-string blank-space #\space))
+ (apply
+ string-append
+ (for/list ([exp (in-list exps)]
+ [i (in-naturals)])
+ (define first-line? (= i 0))
+ (if (= i 0)
+ (format "~e" exp)
+ (format "\n~a~e" blank exp)))))
+
(lambda (str)
(if (eval-results? str)
(list #f
diff --git a/scribble-lib/scribble/latex-render.rkt b/scribble-lib/scribble/latex-render.rkt
@@ -1150,6 +1150,11 @@
[(#\↝) "$\\leadsto$"]
[(#\↱) "$\\Lsh$"]
[(#\↰) "$\\Rsh$"]
+ [(#\⇀) "$\\rightharpoonup$"]
+ [(#\↼) "$\\leftharpoonup$"]
+ [(#\⇁) "$\\rightharpoondown$"]
+ [(#\↽) "$\\leftharpoondown$"]
+ [(#\⇌) "$\\rightleftharpoons$"]
[(#\⇕) "$\\Updownarrow$"]
[(#\א) "$\\aleph$"]
[(#\′) "$\\prime$"]
@@ -1174,6 +1179,7 @@
[(#\∀) "$\\forall$"]
[(#\∃) "$\\exists$"]
[(#\∘) "$\\circ$"]
+ [(#\∂) "$\\partial$"]
[(#\θ) "$\\theta$"]
[(#\ϑ) "$\\vartheta$"]
[(#\τ) "$\\tau$"]