add Quad version info to metadata (closes #53)

main
Matthew Butterick 5 years ago
parent 3a21e7dd9a
commit ec2f0724ce

@ -0,0 +1,9 @@
#lang racket/base
(require racket/match pkg/path)
(provide pkg-checksum)
(define (pkg-checksum [pkg "quad"] #:short [short? #false])
(match (for/or ([scope (in-list '(user installation shared))])
(hash-ref (read-pkgs-db scope) pkg #false))
[(pkg-info _ checksum _) (if short? (substring checksum 0 7) checksum)]
[_ "checksum not found"]))

@ -11,7 +11,8 @@
"wrap.rkt"
"position.rkt"
"param.rkt"
"util.rkt")
"util.rkt"
"checksum.rkt")
(provide (all-from-out "atomize.rkt"
"quad.rkt"
@ -19,4 +20,5 @@
"wrap.rkt"
"position.rkt"
"param.rkt"
"util.rkt"))
"util.rkt"
"checksum.rkt"))

@ -218,7 +218,7 @@
(define (setup-pdf-metadata! qs pdf)
(define kv-dict
(cons
(cons 'Creator (format "Racket ~a [Quad library]" (version)))
(cons 'Creator (format "Racket ~a [Quad ~a]" (version) (pkg-checksum "quad" #:short #true)))
(for*/list ([(k pdf-k) (in-dict (list (cons :pdf-title 'Title)
(cons :pdf-author 'Author)
(cons :pdf-subject 'Subject)

Loading…
Cancel
Save