commit fae7c006586ea133188d6e83f8cc983d3a2f0c1e
parent 58183ac7407342c194ffec9cddba326b0565543e
Author: Robby Findler <robby@racket-lang.org>
Date: Thu, 26 May 2011 15:34:01 -0500
sriblib/autobib: added a keyword argument to generate-bibliography to control the name of the section
original commit: 62d758ca56d16ceb8c4f55460ffdb904a52b002d
Diffstat:
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/collects/scriblib/autobib.rkt b/collects/scriblib/autobib.rkt
@@ -96,7 +96,7 @@
(string->number (auto-bib-date b)))
-(define (gen-bib tag group)
+(define (gen-bib tag group sec-title)
(let* ([author/date<?
(lambda (a b)
(or
@@ -110,7 +110,7 @@
(make-part
#f
`((part ,tag))
- '("Bibliography")
+ (list sec-title)
(make-style #f '(unnumbered))
null
(list
@@ -150,8 +150,8 @@
(add-cites group (cons bib-entry bib-entries)))
(define (citet bib-entry . bib-entries)
(add-inline-cite group (cons bib-entry bib-entries)))
- (define (generate-bibliography #:tag [tag "doc-bibliography"])
- (gen-bib tag group))))
+ (define (generate-bibliography #:tag [tag "doc-bibliography"] #:sec-title [sec-title "Bibliography"])
+ (gen-bib tag group sec-title))))
(define (ends-in-punc? e)
(regexp-match? #rx"[.!?,]$" (content->string e)))
diff --git a/collects/scriblib/scribblings/autobib.scrbl b/collects/scriblib/scribblings/autobib.scrbl
@@ -20,7 +20,7 @@ to one or more bibliography entries with a preceding non-breaking
space. It has the contract
@schemeblock[
-((bib?) () (listof bib?) . ->* . element?)
+(->* (bib?) () #:rest (listof bib?) element?)
]
The function bound to @scheme[citet-id] generates an element suitable
@@ -28,15 +28,19 @@ for use as a noun---referring to a document or its author---for one
or more bibliography entries which share an author. It has the contract
@schemeblock[
-((bib?) () (listof bib?) . ->* . element?)
+(->* (bib?) () #:rest (listof bib?) element?)
]
The function bound to @scheme[generate-bibliography-id] generates the
section for the bibliography. It has the contract
@schemeblock[
-(() (#:tag [tag "doc-bibliography"]) null? . ->* . part?)
-]}
+(->* () (#:tag string? #:sec-title string?) part?)
+]
+
+The default value for the @racket[#:tag] argument is @racket["doc-bibliography"]
+and for @racket[#:sec-title] is @racket["Bibliography"].
+}
@defproc[(bib? [v any/c]) boolean?]{