<commit_before>#lang scribble/manual
@(require (for-label scribble/struct
                     scriblib/autobib
                     scheme/base
                     scheme/contract))

@title[#:tag "autobib"]{Bibliographies}

@defmodule[scriblib/autobib]


@defform[(define-cite ~cite-id citet-id generate-bibliography-id
                      [#:disambiguate disambiguator]
                      [#:render-date-bib render-date]
                      [#:render-date-cite render-date]
                      [#:date<? date-compare]
                      [#:date=? date-compare])]{

Binds @racket[~cite-id], @racket[citet-id], and
@racket[generate-bibliography-id], which share state to accumulate and render
citations. If two citations' references would render the same (as judged by equal authors and dates are @racket[date=?]) but are
different, the optionally provided disambiguation function is used to add an
extra element after the date. The default disambiguator will add "a", "b", etc
until "z". Anything more ambiguous will throw an error. It has the contract
<commit_msg>Add an example to scriblib/autobib docs.<commit_after>#lang scribble/manual
@(require (for-label scribble/struct
                     scriblib/autobib
                     scheme/base
                     scheme/contract))

@title[#:tag "autobib"]{Bibliographies}

@defmodule[scriblib/autobib]

This library provides support for bibliography management in a Scribble
document. The @racket[define-cite] form is used to bind procedures
that create in-line citations and generate the bibilography in the
document.

Individual bibliography entries are created with the @racket[make-bib]
function. See below for an example.

@codeblock|{
  #lang scribble/base

  @(require scriblib/autobib)

  @(define-cite ~cite citet generate-bibliography)

  @(define plt-tr1
     (make-bib
      #:title    "Reference: Racket"
      #:author   (authors "<NAME>" "PLT")
      #:date     "2010"
      #:location (techrpt-location #:institution "PLT Inc." #:number "PLT-TR-2010-1")
      #:url      "http://racket-lang.org/tr1/"))

  Racket is fun@~cite[plt-tr1].

  @(generate-bibliography)
}|

@defform[(define-cite ~cite-id citet-id generate-bibliography-id
                      [#:disambiguate disambiguator]
                      [#:render-date-bib render-date]
                      [#:render-date-cite render-date]
                      [#:date<? date-compare]
                      [#:date=? date-compare])]{

Binds @racket[~cite-id], @racket[citet-id], and
@racket[generate-bibliography-id], which share state to accumulate and render
citations. If two citations' references would render the same (as judged by equal authors and dates are @racket[date=?]) but are
different, the optionally provided disambiguation function is used to add an
extra element after the date. The default disambiguator will add "a", "b", etc
until "z". Anything more ambiguous will throw an error. It has the contract

{'fraction_non_alphanumeric': 0.10657672849915684, 'fraction_numerical': 0.004047217537942664, 'mean_word_length': 2.792838874680307, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4881508', 'n_tokens_mistral': 913, 'n_tokens_neox': 823, 'n_words': 271}