# app.hemel.snippet

> A single block of code with its metadata. Commentary lives in the Bluesky post that embeds the record.

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

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:k7xaumlhlodlujjun5va7pr2/app.hemel.snippet)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:k7xaumlhlodlujjun5va7pr2/app.hemel.snippet/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:k7xaumlhlodlujjun5va7pr2/app.hemel.snippet/analytics)

## Record (`app.hemel.snippet`)

Type: record · key tid

### Properties

- `code` (string, required): The code, verbatim.
  - Constraints: maxLength: 50000
- `createdAt` (string · datetime, required)
- `filename` (string)
  - Constraints: maxLength: 256
- `highlight` (array): Line ranges to emphasize.
  - Constraints: maxLength: 64
  - `items` (ref)
    - Reference: `#lineRange`
- `lang` (string, required): Language identifier used for highlighting, for example rust or diff.
  - Constraints: minLength: 1, maxLength: 64
- `title` (string)
  - Constraints: maxLength: 1000, maxGraphemes: 100

## #lineRange (`app.hemel.snippet#lineRange`)

Type: object

An inclusive range of 1-based line numbers.

### Properties

- `end` (integer, required)
  - Constraints: minimum: 1
- `start` (integer, required)
  - Constraints: minimum: 1

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "lineRange": {
      "description": "An inclusive range of 1-based line numbers.",
      "properties": {
        "end": {
          "minimum": 1,
          "type": "integer"
        },
        "start": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "start",
        "end"
      ],
      "type": "object"
    },
    "main": {
      "description": "A single block of code with its metadata. Commentary lives in the Bluesky post that embeds the record.",
      "key": "tid",
      "record": {
        "properties": {
          "code": {
            "description": "The code, verbatim.",
            "maxLength": 50000,
            "type": "string"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "filename": {
            "maxLength": 256,
            "type": "string"
          },
          "highlight": {
            "description": "Line ranges to emphasize.",
            "items": {
              "ref": "#lineRange",
              "type": "ref"
            },
            "maxLength": 64,
            "type": "array"
          },
          "lang": {
            "description": "Language identifier used for highlighting, for example rust or diff.",
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "title": {
            "maxGraphemes": 100,
            "maxLength": 1000,
            "type": "string"
          }
        },
        "required": [
          "code",
          "lang",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "app.hemel.snippet",
  "lexicon": 1
}
```
