◊(Local Yarn Code "series-list.rkt at [71cdd100]")

File series-list.rkt artifact 88c1de55 part of check-in 71cdd100


#lang racket/base

; SPDX-License-Identifier: BlueOak-1.0.0
; This file is licensed under the Blue Oak Model License 1.0.0.

;; Provides fast metadata for series.
;; TO MAKE A NEW SERIES:
;;   1. Create series/my-key.poly.pm
;;   2. Add an entry for my-key to series-list below
;;   3. Use ◊define-meta[series "my-key"] in articles to add them to the series.
;;   4. If ptree-ordered is #t, also create series/my-key.ptree

(require racket/list)
(struct series (key title noun-plural noun-singular ptree-ordered?))

(define series-list
  (make-immutable-hash
   (list
   ;; ------- DEFINE SERIES HERE -----------
            ; Key               Title              plural noun    singular noun phrase
   (+series "marquee-fiction"   "Marquee Fiction" "inventions"    "an invention"         #f)
   )))

(define (series-grouped-list)
  (group-by series-noun-plural (hash-values series-list)))

;; Quick macro to save a little typing
(define-syntax-rule (+series key title plural singular ptree)
  (cons key (series key title plural singular ptree)))

(provide (struct-out series)
         series-list
         series-grouped-list)