Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/docs/(overview)/glossary.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Marfa uses each word below in one sense only, in its code, its API and these doc
| [**reverse name**](/properties-metadata-and-edges#edges) | An edge's name read from its target: `child-of` for `parent-of`. |
| [**label**](/properties-metadata-and-edges#edges) | The heading a type or an edge type shows for itself. An edge type's label heads the source's end of an edge, such as `Children` for `parent-of`. |
| [**reverse label**](/properties-metadata-and-edges#edges) | The heading an edge type shows for the target's end, such as `Parent`. Where an edge type names none, its label names both ends. |
| [**collection**](/catalog/edges) | A flat container of items. An item joins one through an `in-collection` edge to an item whose type has the `container` role, such as an album. An item can be in many, a container can't itself be a member, and deleting the container leaves its members. |
| [**collection**](/catalog/edges) | A flat container of items. An item joins one through an `in-collection` edge to an item whose type has the `container` role, such as a [`core.collection`](/catalog/collection) or an album. An item can be in many, a container can't itself be a member, and deleting the container leaves its members. |
| [**view**](/build/save-a-view) | A saved query with one sort and one grouping, kept on the instance as a `system.view` and shared by every app. How an app draws the items is the app's own. |
| [**file**](/files) | An item that names its bytes. |
| [**blob**](/files) | A file's bytes, stored once under a hash of their content. |
Expand Down
32 changes: 32 additions & 0 deletions content/docs/catalog/(types)/(core)/collection.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Collection
description: "Items of any type that you gather together. Members join it through the in-collection edge, and it can hold any item but another container."
identifier: core.collection
---

<include cwd>src/generated/catalog/core.collection.md</include>

## Example

```json
{
"type": "core.collection",
"properties": {
"title": "Kitchen renovation",
"description": "Quotes, sketches and the tasks still to book."
}
}
```

An item joins the collection through an [`in-collection`](/catalog/edges#in-collection) edge from the item to the collection, with an optional `position`:

```json
{
"source_id": "01a12313-ad0e-71cd-99b4-7a176c5a9f18",
"target_id": "01a12314-0b52-7c41-8e0f-2d6f1a3b9c07",
"edge_type": "in-collection",
"properties": { "position": 1 }
}
```

A container, such as another collection or an album, can't be a member. An item can be in any number of collections, and deleting a collection leaves its members in place.
1 change: 1 addition & 0 deletions content/docs/catalog/(types)/(core)/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"defaultOpen": false,
"pages": [
"bookmark",
"collection",
"entity",
"event",
"file",
Expand Down
2 changes: 1 addition & 1 deletion src/generated/GLOSSARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Access is read the same way wherever a person sees it: on the pages where they a
| **placement** | Where an item's file sits in a folder: its `in-folder` edge to the folder's `system.folder`, whose `path` names the file from the folder's root. It never decides what a folder holds, and it is never written in a file. |
| **registry** | The folder registry: one file on a machine listing its folders, each by its directory and the `system.folder` it follows, so each folder can find the others and a file moved or copied between two of them is told apart. It is never a folder's store, and `MARFA_FOLDER_REGISTRY` names another file in its place. The type registry is the server's catalog of types (`types.md`). |
| **embed** | A file an item's body shows inside it, `![](path)` or `![[file]]`: that file item's `attached-to` edge to the item, in a folder's Markdown file and in a body written through a working copy alike. In a folder, the file's `has-attachment` line lists only what the body does not embed, and an embedded file is put where the link says, any other attachment beside the document. It names a file where a file answers to it or its extension names a MIME type; anything else, `![[A note]]` say, is an embed of a note, text in the body and neither a link nor an edge. |
| **collection** | A container and its members: an item whose type declares the `container` role, such as an album or a series, and the items joined to it by an `in-collection` edge, each with an optional `position`. Flat: a container is never a member, `parent-of` is what hierarchy is for, and deleting the container leaves its members. Not a folder and not a view. |
| **collection** | A container and its members: an item whose type declares the `container` role, such as `core.collection`, an album or a series, and the items joined to it by an `in-collection` edge, each with an optional `position`. Flat: a container is never a member, `parent-of` is what hierarchy is for, and deleting the container leaves its members. Not a folder and not a view. |
| **frontmatter** | The block of `key: value` lines a Markdown file in a folder opens with between `---` fences. Its `type`, `tier`, `tags`, `state` and `occurred_at` lines are the item's own fields; `marfa_id` and `marfa_version` name the item and the version the file was written from; a line named for an edge type or a reverse name is an edge's, written in the one file at the end the type names and naming its targets as `"[[name]]"` or `"[[<id>]]"`; every other line is a property. The file's body is the property its type's `body_field` names. Never "header". |

### Connectors
Expand Down
27 changes: 27 additions & 0 deletions src/generated/catalog/builtin-catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,33 @@
"default": "last_writer_wins"
}
},
{
"id": "core.collection",
"label": "Collection",
"description": "Items of any type that you gather together. Members join it through the in-collection edge, and it can hold any item but another container.",
"version": 0,
"fields": {
"title": {
"type": "string",
"description": "Name of the collection",
"required": true
},
"description": {
"type": "string",
"description": "What the collection gathers"
}
},
"display_hints": {
"title_field": "title",
"body_field": "description"
},
"merge_policy": {
"default": "last_writer_wins"
},
"roles": [
"container"
]
},
{
"id": "core.entity",
"label": "Entity",
Expand Down
15 changes: 15 additions & 0 deletions src/generated/catalog/core.collection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Fields

| Field | Kind | Required | Description |
| ------------- | -------- | -------- | --------------------------- |
| `title` | `string` | Yes | Name of the collection |
| `description` | `string` | No | What the collection gathers |

## Settings

| Setting | Value |
| ------------------------------------------------------ | ---------------------------------- |
| [`title_field`](/catalog/your-own-types#fields) | `title` |
| [`body_field`](/catalog/your-own-types#fields) | `description` |
| [`merge_policy`](/catalog/your-own-types#merge-policy) | `last_writer_wins` for every field |
| [`roles`](/catalog/your-own-types#roles) | `container` |
Loading
Loading