# at.markpub.facets.baseFormatting

> Published by [markpub.at](https://lexicon.garden/identity/did:plc:kfxbexqtvw76572grhv2f3on)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:kfxbexqtvw76572grhv2f3on/at.markpub.facets.baseFormatting)
- [Documentation](https://lexicon.garden/lexicon/did:plc:kfxbexqtvw76572grhv2f3on/at.markpub.facets.baseFormatting/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:kfxbexqtvw76572grhv2f3on/at.markpub.facets.baseFormatting/examples)

## Definitions

### `at.markpub.facets.baseFormatting`

**Type**: `object`

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

### `at.markpub.facets.baseFormatting#idify`

**Type**: `object`

Facet feature instructs parsers to stringify the underlying text and include it as an id property on an HTML element. If this overlaps with an existing HTML tag generated by another facet, it is assumed that it will be applied to that tag. If there is no matching tag, use `&lt;span&gt;&lt;/span&gt;`. It is expected spaces are turned into hyphens. For example, a header facet with an idify feature might produce `&lt;h1 id="header-text"&gt;Header Text&lt;/h1&gt;`.

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

### `at.markpub.facets.baseFormatting#header`

**Type**: `object`

Facet feature for a `&lt;h1&gt;` HTML tag. The integer is the level you want to use, as in h1, h2, h3, etc... For the byteSlice provided it should surround the underlying text.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `level` | `integer` | Yes |  |

### `at.markpub.facets.baseFormatting#strong`

**Type**: `object`

Facet feature for a `&lt;strong&gt;` HTML tag. For the byteSlice provided it should surround the underlying text.

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

### `at.markpub.facets.baseFormatting#byteSlice`

**Type**: `object`

Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets. Byte slices can overlap.

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

## Raw Schema

```json
{
  "id": "at.markpub.facets.baseFormatting",
  "defs": {
    "main": {
      "type": "object",
      "required": [
        "index",
        "features"
      ],
      "properties": {
        "index": {
          "ref": "#byteSlice",
          "type": "ref"
        },
        "features": {
          "type": "array",
          "items": {
            "refs": [
              "#strong",
              "#header",
              "#idify"
            ],
            "type": "union"
          }
        }
      }
    },
    "idify": {
      "type": "object",
      "properties": {},
      "description": "Facet feature instructs parsers to stringify the underlying text and include it as an id property on an HTML element. If this overlaps with an existing HTML tag generated by another facet, it is assumed that it will be applied to that tag. If there is no matching tag, use `&lt;span&gt;&lt;/span&gt;`. It is expected spaces are turned into hyphens. For example, a header facet with an idify feature might produce `&lt;h1 id=\"header-text\"&gt;Header Text&lt;/h1&gt;`."
    },
    "header": {
      "type": "object",
      "required": [
        "level"
      ],
      "properties": {
        "level": {
          "type": "integer",
          "maximum": 6,
          "minimum": 1
        }
      },
      "description": "Facet feature for a `&lt;h1&gt;` HTML tag. The integer is the level you want to use, as in h1, h2, h3, etc... For the byteSlice provided it should surround the underlying text."
    },
    "strong": {
      "type": "object",
      "properties": {},
      "description": "Facet feature for a `&lt;strong&gt;` HTML tag. For the byteSlice provided it should surround the underlying text."
    },
    "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 zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets. Byte slices can overlap."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
