Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

Work collections #48

Closed
gwennlbh opened this issue May 17, 2022 · 0 comments
Closed

Work collections #48

gwennlbh opened this issue May 17, 2022 · 0 comments
Assignees
Labels

Comments

@gwennlbh
Copy link
Member

gwennlbh commented May 17, 2022

Introduce a new file named collections.yaml lists collections of works.

The file describes an object mapping collection IDs (used in URLs) to objects describing them:

  • title (string, optional) gives a display name to the collection
  • description (HTML string, optional) describes the collection
  • singular (optional, string, default = "work") a work in that collection is a … (e.g. "release", "experiment", etc.) — singular form
  • plural (optional, string, default = "works") same as singular, but in the plural form
  • learn more at (optional, URL string) a link to learn more about that collection. Should be displayed alongside the description.
  • contains (extended Antonmedv expression, required) describes what works should be part of the collection.

A work is part of a collection when contains, after some pre-processing, evaluates to true using an Antonmedv expression.
Variables available to the evaluation context are:

  • work, containing the work the expression is being tested against
  • all work IDs, with only the current work's being set to true and all others being set to false
  • all technologys' URLNames as "tag_tag URLName", with only the ones who are represented by the work's "made with" metadata field set to true and all others set to false
  • all tags' URLNames as "technology_technology URLName", following the same logic as the above.

The pre-processing is done with the following steps:

  1. Replace all dashes without surrounding whitespace with underscores (/(\S)-(\S)/ => \1_\2)
  2. Replace all #-prefixed variables (/\b#(\S.*)\b/) with tag_\1
  3. Replace all 'made with '-prefixed variables (/\bmade with (\S.*)\b/) with technology_\2
  4. Replace all glob patterns (/\b((?:.*\*.*)+)\b/) with an " or "-joined list of all available variables that match the glob pattern, wrapped in parentheses

If a work is part of a collection, the collection's ID is appended to the work's new collections field, which is at the top-level of the work's object in database.json (not in metadata)

Example use case:

math experiments:
  title: Mathematics+experiments
  contains: '#math and #experiments and (#graphism or #video or #sound)'
  description: Expriments on mathematics and art, mostly visual interpretations of concepts that could lead to new insights on said concept.
  singular: experiment
  plural: experiments

acf:
  title: Works for the ACF
  contains: acf-*
  description: A [regional delegation of the École de la Cause freudienne](https://causefreudienne.net/activites/en-regions/voie-domitienne) pyschoanalysis association.
  learn more at: https://www.acfvoiedomitienne.fr/l-acf

music:
  title: I also make electronic music.
  contains: '#music'
  description: |
    I’ve been experimenting with sounds, their textures and their musicality since I was 7 years old.
  singular: release
  plural: releases
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant