# pub.leaflet.document

> Record containing a document

- Kind: record
- Record key: tid
- Authority: leaflet.pub
- Lexicon: 1
- Published by [leaflet.pub](https://lexicon.garden/identity/did:plc:btxrwcaeyodrap5mnjw2fvmz), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:btxrwcaeyodrap5mnjw2fvmz/pub.leaflet.document)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:btxrwcaeyodrap5mnjw2fvmz/pub.leaflet.document/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:btxrwcaeyodrap5mnjw2fvmz/pub.leaflet.document/analytics)

## Record (`pub.leaflet.document`)

Type: record · key tid

### Properties

- `author` (string · at-identifier, required)
- `coverImage` (blob)
  - Constraints: maxSize: 1000000, accept: image/png, image/jpeg, image/webp
- `description` (string)
  - Constraints: maxLength: 30000, maxGraphemes: 3000
- `pages` (array, required)
  - `items` (union)
    - One of: `pub.leaflet.pages.linearDocument`, `pub.leaflet.pages.canvas`
- `postRef` (ref)
  - Reference: `com.atproto.repo.strongRef`
- `preferences` (ref)
  - Reference: `pub.leaflet.publication#preferences`
- `publication` (string · at-uri)
- `publishedAt` (string · datetime)
- `tags` (array)
  - `items` (string)
    - Constraints: maxLength: 50
- `theme` (ref)
  - Reference: `pub.leaflet.publication#theme`
- `title` (string, required)
  - Constraints: maxLength: 5000, maxGraphemes: 500

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Record containing a document",
      "key": "tid",
      "record": {
        "properties": {
          "author": {
            "format": "at-identifier",
            "type": "string"
          },
          "coverImage": {
            "accept": [
              "image/png",
              "image/jpeg",
              "image/webp"
            ],
            "maxSize": 1000000,
            "type": "blob"
          },
          "description": {
            "maxGraphemes": 3000,
            "maxLength": 30000,
            "type": "string"
          },
          "pages": {
            "items": {
              "refs": [
                "pub.leaflet.pages.linearDocument",
                "pub.leaflet.pages.canvas"
              ],
              "type": "union"
            },
            "type": "array"
          },
          "postRef": {
            "ref": "com.atproto.repo.strongRef",
            "type": "ref"
          },
          "preferences": {
            "ref": "pub.leaflet.publication#preferences",
            "type": "ref"
          },
          "publication": {
            "format": "at-uri",
            "type": "string"
          },
          "publishedAt": {
            "format": "datetime",
            "type": "string"
          },
          "tags": {
            "items": {
              "maxLength": 50,
              "type": "string"
            },
            "type": "array"
          },
          "theme": {
            "ref": "pub.leaflet.publication#theme",
            "type": "ref"
          },
          "title": {
            "maxGraphemes": 500,
            "maxLength": 5000,
            "type": "string"
          }
        },
        "required": [
          "pages",
          "author",
          "title"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "description": "A lexicon for long form rich media documents",
  "id": "pub.leaflet.document",
  "lexicon": 1,
  "revision": 1
}
```
