# net.atview.richtext.facet

> Published by [atview.net](https://lexicon.garden/identity/did:plc:ycd3zyxa6iru5fiplr3un6nr)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:ycd3zyxa6iru5fiplr3un6nr/net.atview.richtext.facet)
- [Documentation](https://lexicon.garden/lexicon/did:plc:ycd3zyxa6iru5fiplr3un6nr/net.atview.richtext.facet/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:ycd3zyxa6iru5fiplr3un6nr/net.atview.richtext.facet/examples)

## Definitions

### `net.atview.richtext.facet#b`

**Type**: `object`

Bold inline emphasis.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#i`

**Type**: `object`

Italic inline emphasis.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#u`

**Type**: `object`

Underline inline emphasis.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#h2`

**Type**: `object`

Level 2 heading block.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#h3`

**Type**: `object`

Level 3 heading block.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#h4`

**Type**: `object`

Level 4 heading block.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#h5`

**Type**: `object`

Level 5 heading block.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#h6`

**Type**: `object`

Level 6 heading block.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#ol`

**Type**: `object`

Ordered list item block.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#ul`

**Type**: `object`

Unordered list item block.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#code`

**Type**: `object`

Inline monospace / code span.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#link`

**Type**: `object`

Hyperlink inline feature.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (uri) | Yes |  |

### `net.atview.richtext.facet`

**Type**: `object`

Annotation of a sub-string within the parent record's `textContent`. Byte offsets refer to a UTF-8 encoding of the string. A single facet may carry multiple features that all apply to the same byte range.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `index` | `ref` → `#byteSlice` | Yes |  |
| `features` | `array` | Yes |  |

### `net.atview.richtext.facet#math`

**Type**: `object`

Math block expressed as TeX source.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `tex` | `string` | Yes |  |

### `net.atview.richtext.facet#media`

**Type**: `object`

Inline/embedded media (image) with optional metadata.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `image` | `blob` | Yes |  |
| `title` | `string` | No |  |
| `altText` | `string` | No |  |
| `caption` | `string` | No |  |
| `aspectRatio` | `ref` → `#aspectRatio` | No |  |

### `net.atview.richtext.facet#iframe`

**Type**: `object`

Embedded iframe block.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `url` | `string` (uri) | Yes |  |
| `height` | `integer` | No |  |

### `net.atview.richtext.facet#mention`

**Type**: `object`

Mention of an account by DID.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |

### `net.atview.richtext.facet#website`

**Type**: `object`

External website embed.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (uri) | Yes |  |
| `title` | `string` | No |  |

### `net.atview.richtext.facet#bskyPost`

**Type**: `object`

Embedded reference to a Bluesky post (app.bsky.feed.post).

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | No |  |
| `uri` | `string` (at-uri) | Yes |  |

### `net.atview.richtext.facet#byteSlice`

**Type**: `object`

Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are in UTF-8 bytes.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `byteEnd` | `integer` | Yes |  |
| `byteStart` | `integer` | Yes |  |

### `net.atview.richtext.facet#codeBlock`

**Type**: `object`

Fenced code block with optional language hint.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `language` | `string` | No |  |

### `net.atview.richtext.facet#hardBreak`

**Type**: `object`

Hard line break within a paragraph.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#highlight`

**Type**: `object`

Highlighted inline emphasis.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#blockquote`

**Type**: `object`

Blockquote block.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#aspectRatio`

**Type**: `object`

Width/height ratio of an image, in arbitrary same-unit pixels.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `width` | `integer` | Yes |  |
| `height` | `integer` | Yes |  |

### `net.atview.richtext.facet#strikethrough`

**Type**: `object`

Strikethrough inline emphasis.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `net.atview.richtext.facet#horizontalRule`

**Type**: `object`

Horizontal rule / thematic break block.

| Property | Type | Required | Description |
|----------|------|----------|-------------|

## Raw Schema

```json
{
  "id": "net.atview.richtext.facet",
  "defs": {
    "b": {
      "type": "object",
      "properties": {},
      "description": "Bold inline emphasis."
    },
    "i": {
      "type": "object",
      "properties": {},
      "description": "Italic inline emphasis."
    },
    "u": {
      "type": "object",
      "properties": {},
      "description": "Underline inline emphasis."
    },
    "h2": {
      "type": "object",
      "properties": {},
      "description": "Level 2 heading block."
    },
    "h3": {
      "type": "object",
      "properties": {},
      "description": "Level 3 heading block."
    },
    "h4": {
      "type": "object",
      "properties": {},
      "description": "Level 4 heading block."
    },
    "h5": {
      "type": "object",
      "properties": {},
      "description": "Level 5 heading block."
    },
    "h6": {
      "type": "object",
      "properties": {},
      "description": "Level 6 heading block."
    },
    "ol": {
      "type": "object",
      "properties": {},
      "description": "Ordered list item block."
    },
    "ul": {
      "type": "object",
      "properties": {},
      "description": "Unordered list item block."
    },
    "code": {
      "type": "object",
      "properties": {},
      "description": "Inline monospace / code span."
    },
    "link": {
      "type": "object",
      "required": [
        "uri"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "uri"
        }
      },
      "description": "Hyperlink inline feature."
    },
    "main": {
      "type": "object",
      "required": [
        "index",
        "features"
      ],
      "properties": {
        "index": {
          "ref": "#byteSlice",
          "type": "ref"
        },
        "features": {
          "type": "array",
          "items": {
            "refs": [
              "#b",
              "#i",
              "#u",
              "#code",
              "#strikethrough",
              "#highlight",
              "#link",
              "#mention",
              "#h2",
              "#h3",
              "#h4",
              "#h5",
              "#h6",
              "#blockquote",
              "#codeBlock",
              "#media",
              "#bskyPost",
              "#ul",
              "#ol",
              "#website",
              "#horizontalRule",
              "#iframe",
              "#math",
              "#hardBreak"
            ],
            "type": "union"
          }
        }
      },
      "description": "Annotation of a sub-string within the parent record's `textContent`. Byte offsets refer to a UTF-8 encoding of the string. A single facet may carry multiple features that all apply to the same byte range."
    },
    "math": {
      "type": "object",
      "required": [
        "tex"
      ],
      "properties": {
        "tex": {
          "type": "string",
          "maxLength": 20000,
          "maxGraphemes": 10000
        }
      },
      "description": "Math block expressed as TeX source."
    },
    "media": {
      "type": "object",
      "required": [
        "image"
      ],
      "properties": {
        "image": {
          "type": "blob",
          "accept": [
            "image/*"
          ],
          "maxSize": 5000000
        },
        "title": {
          "type": "string",
          "maxLength": 5000,
          "maxGraphemes": 500
        },
        "altText": {
          "type": "string",
          "maxLength": 10000,
          "maxGraphemes": 1000
        },
        "caption": {
          "type": "string",
          "maxLength": 10000,
          "maxGraphemes": 1000
        },
        "aspectRatio": {
          "ref": "#aspectRatio",
          "type": "ref"
        }
      },
      "description": "Inline/embedded media (image) with optional metadata."
    },
    "iframe": {
      "type": "object",
      "required": [
        "url"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "height": {
          "type": "integer",
          "minimum": 1
        }
      },
      "description": "Embedded iframe block."
    },
    "mention": {
      "type": "object",
      "required": [
        "did"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did"
        }
      },
      "description": "Mention of an account by DID."
    },
    "website": {
      "type": "object",
      "required": [
        "uri"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "uri"
        },
        "title": {
          "type": "string",
          "maxLength": 5000,
          "maxGraphemes": 500
        }
      },
      "description": "External website embed."
    },
    "bskyPost": {
      "type": "object",
      "required": [
        "uri"
      ],
      "properties": {
        "cid": {
          "type": "string",
          "format": "cid"
        },
        "uri": {
          "type": "string",
          "format": "at-uri"
        }
      },
      "description": "Embedded reference to a Bluesky post (app.bsky.feed.post)."
    },
    "byteSlice": {
      "type": "object",
      "required": [
        "byteStart",
        "byteEnd"
      ],
      "properties": {
        "byteEnd": {
          "type": "integer",
          "minimum": 0
        },
        "byteStart": {
          "type": "integer",
          "minimum": 0
        }
      },
      "description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are in UTF-8 bytes."
    },
    "codeBlock": {
      "type": "object",
      "properties": {
        "language": {
          "type": "string",
          "maxLength": 100
        }
      },
      "description": "Fenced code block with optional language hint."
    },
    "hardBreak": {
      "type": "object",
      "properties": {},
      "description": "Hard line break within a paragraph."
    },
    "highlight": {
      "type": "object",
      "properties": {},
      "description": "Highlighted inline emphasis."
    },
    "blockquote": {
      "type": "object",
      "properties": {},
      "description": "Blockquote block."
    },
    "aspectRatio": {
      "type": "object",
      "required": [
        "width",
        "height"
      ],
      "properties": {
        "width": {
          "type": "integer",
          "minimum": 1
        },
        "height": {
          "type": "integer",
          "minimum": 1
        }
      },
      "description": "Width/height ratio of an image, in arbitrary same-unit pixels."
    },
    "strikethrough": {
      "type": "object",
      "properties": {},
      "description": "Strikethrough inline emphasis."
    },
    "horizontalRule": {
      "type": "object",
      "properties": {},
      "description": "Horizontal rule / thematic break block."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
