net.atchan.richtext.facet

atchan.net

Documentation

A facet defines a range of rich text within a larger string.

main object

A facet defines a range of rich text within a larger string.

Properties

index ref #byteSlice Required

No description available.

View raw schema
{
  "type": "object",
  "required": [
    "index",
    "features"
  ],
  "properties": {
    "index": {
      "ref": "#byteSlice",
      "type": "ref"
    },
    "features": {
      "type": "array",
      "items": {
        "refs": [
          "#bold",
          "#italic",
          "#underline",
          "#strikethrough",
          "#spoiler",
          "#color",
          "#size",
          "#font",
          "#kaomoji",
          "#aa",
          "#code",
          "#pre",
          "#link",
          "#ref"
        ],
        "type": "union"
      },
      "minLength": 1
    }
  },
  "description": "A facet defines a range of rich text within a larger string."
}
aa object

Facet feature rendering the range in a Shift_JIS art font, as a block with whitespace preserved. This is a choice of typeface, not a claim about what the range says: it is the font ASCII art (AA) is drawn against, and only in it does the art keep its intended proportions. No other facet is valid inside it.

This object has no properties defined.

View raw schema
{
  "type": "object",
  "properties": {},
  "description": "Facet feature rendering the range in a Shift_JIS art font, as a block with whitespace preserved. This is a choice of typeface, not a claim about what the range says: it is the font ASCII art (AA) is drawn against, and only in it does the art keep its intended proportions. No other facet is valid inside it."
}
bold object

Facet feature marking the range as bold.

This object has no properties defined.

View raw schema
{
  "type": "object",
  "properties": {},
  "description": "Facet feature marking the range as bold."
}
byteSlice 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.

Properties

byteEnd integer Required

No description available.

minimum: 0
byteStart integer Required

No description available.

minimum: 0
View raw schema
{
  "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."
}
code object

Facet feature marking the range as inline code, rendered in a monospace font. No other facet is valid inside it.

This object has no properties defined.

View raw schema
{
  "type": "object",
  "properties": {},
  "description": "Facet feature marking the range as inline code, rendered in a monospace font. No other facet is valid inside it."
}
color object

Facet feature rendering the range in a color, given as a CSS hex color such as "#ff0000".

Properties

value string Required

No description available.

View raw schema
{
  "type": "object",
  "required": [
    "value"
  ],
  "properties": {
    "value": {
      "type": "string"
    }
  },
  "description": "Facet feature rendering the range in a color, given as a CSS hex color such as \"#ff0000\"."
}
font object

Facet feature rendering the range in a named font

Properties

name string Required

No description available.

View raw schema
{
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string"
    }
  },
  "description": "Facet feature rendering the range in a named font"
}
italic object

Facet feature marking the range as italic.

This object has no properties defined.

View raw schema
{
  "type": "object",
  "properties": {},
  "description": "Facet feature marking the range as italic."
}
kaomoji object

Facet feature marking the range as a kaomoji, ideally rendered in a Shift-JIS font.

This object has no properties defined.

View raw schema
{
  "type": "object",
  "properties": {},
  "description": "Facet feature marking the range as a kaomoji, ideally rendered in a Shift-JIS font."
}
link object

Facet feature marking the range as a link to a uri

Properties

uri string uri Required

A valid URI.

View raw schema
{
  "type": "object",
  "required": [
    "uri"
  ],
  "properties": {
    "uri": {
      "type": "string",
      "format": "uri"
    }
  },
  "description": "Facet feature marking the range as a link to a uri"
}
pre object

Facet feature marking the range as preformatted text, rendered as a block in a monospace font with whitespace preserved. No other facet is valid inside it.

This object has no properties defined.

View raw schema
{
  "type": "object",
  "properties": {},
  "description": "Facet feature marking the range as preformatted text, rendered as a block in a monospace font with whitespace preserved. No other facet is valid inside it."
}
ref object

Facet feature marking the range as a quote-link to another post, given by its record key. The range covers the ">>rkey" the author typed.

Properties

rkey string record-key Required

A valid record key for AT Protocol repositories.

View raw schema
{
  "type": "object",
  "required": [
    "rkey"
  ],
  "properties": {
    "rkey": {
      "type": "string",
      "format": "record-key"
    }
  },
  "description": "Facet feature marking the range as a quote-link to another post, given by its record key. The range covers the \">>rkey\" the author typed."
}
size object

Facet feature rendering the range at a relative text size from 1 (smallest) to 5 (largest), with 3 being the default.

Properties

value integer Required

No description available.

minimum: 1maximum: 5
View raw schema
{
  "type": "object",
  "required": [
    "value"
  ],
  "properties": {
    "value": {
      "type": "integer",
      "maximum": 5,
      "minimum": 1
    }
  },
  "description": "Facet feature rendering the range at a relative text size from 1 (smallest) to 5 (largest), with 3 being the default."
}
spoiler object

Facet feature marking the range as a spoiler, hidden until the reader interacts with it.

This object has no properties defined.

View raw schema
{
  "type": "object",
  "properties": {},
  "description": "Facet feature marking the range as a spoiler, hidden until the reader interacts with it."
}
strikethrough object

Facet feature marking the range as struck through.

This object has no properties defined.

View raw schema
{
  "type": "object",
  "properties": {},
  "description": "Facet feature marking the range as struck through."
}
underline object

Facet feature marking the range as underlined.

This object has no properties defined.

View raw schema
{
  "type": "object",
  "properties": {},
  "description": "Facet feature marking the range as underlined."
}

Lexicon Garden

@