···11+Copyright 2026 comet.sh
22+33+Permission is hereby granted, free of charge, to any person obtaining a copy of
44+this software and associated documentation files (the “Software”), to deal in
55+the Software without restriction, including without limitation the rights to
66+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
77+the Software, and to permit persons to whom the Software is furnished to do so,
88+subject to the following conditions:
99+1010+The above copyright notice and this permission notice shall be included in all
1111+copies or substantial portions of the Software.
1212+1313+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1414+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
1515+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
1616+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
1717+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1818+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+18
README.md
···11+# atex_standard_site
22+33+This package contains the [Standard.site] lexicons translated into Elixir modules for use with [atex].
44+55+## Installation
66+77+Add `atex_standard_site` to your list of dependencies in `mix.exs`:
88+99+```elixir
1010+def deps do
1111+ [
1212+ {:atex_standard_site, "~> 0.1"}
1313+ ]
1414+end
1515+```
1616+1717+[Standard.site]: https://standard.site/
1818+[atex]: https://github.com/cometsh/atex
···11+defmodule Site.Standard.Document do
22+ @moduledoc false
33+ use Atex.Lexicon
44+55+ deflexicon(%{
66+ id: "site.standard.document",
77+ defs: %{
88+ main: %{
99+ type: "record",
1010+ record: %{
1111+ type: "object",
1212+ required: ["site", "title", "publishedAt"],
1313+ properties: %{
1414+ path: %{
1515+ type: "string",
1616+ description:
1717+ "Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash."
1818+ },
1919+ description: %{
2020+ type: "string",
2121+ description: "A brief description or excerpt from the document.",
2222+ maxGraphemes: 3000,
2323+ maxLength: 30000
2424+ },
2525+ title: %{
2626+ type: "string",
2727+ description: "Title of the document.",
2828+ maxGraphemes: 500,
2929+ maxLength: 5000
3030+ },
3131+ bskyPostRef: %{
3232+ type: "ref",
3333+ description:
3434+ "Strong reference to a Bluesky post. Useful to keep track of comments off-platform.",
3535+ ref: "com.atproto.repo.strongRef"
3636+ },
3737+ content: %{
3838+ closed: false,
3939+ type: "union",
4040+ description:
4141+ "Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats.",
4242+ refs: []
4343+ },
4444+ coverImage: %{
4545+ type: "blob",
4646+ accept: ["image/*"],
4747+ description: "Image to used for thumbnail or cover image. Less than 1MB is size.",
4848+ maxSize: 1_000_000
4949+ },
5050+ publishedAt: %{
5151+ type: "string",
5252+ format: "datetime",
5353+ description: "Timestamp of the documents publish time."
5454+ },
5555+ site: %{
5656+ type: "string",
5757+ format: "uri",
5858+ description:
5959+ "Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes."
6060+ },
6161+ tags: %{
6262+ type: "array",
6363+ description:
6464+ "Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags.",
6565+ items: %{type: "string", maxGraphemes: 128, maxLength: 1280}
6666+ },
6767+ textContent: %{
6868+ type: "string",
6969+ description:
7070+ "Plaintext representation of the documents contents. Should not contain markdown or other formatting."
7171+ },
7272+ updatedAt: %{
7373+ type: "string",
7474+ format: "datetime",
7575+ description: "Timestamp of the documents last edit."
7676+ }
7777+ }
7878+ },
7979+ description:
8080+ "A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently.",
8181+ key: "tid"
8282+ }
8383+ },
8484+ lexicon: 1
8585+ })
8686+end
+28
lib/atproto/site/standard/graph/subscription.ex
···11+defmodule Site.Standard.Graph.Subscription do
22+ @moduledoc false
33+ use Atex.Lexicon
44+55+ deflexicon(%{
66+ id: "site.standard.graph.subscription",
77+ defs: %{
88+ main: %{
99+ type: "record",
1010+ record: %{
1111+ type: "object",
1212+ required: ["publication"],
1313+ properties: %{
1414+ publication: %{
1515+ type: "string",
1616+ format: "at-uri",
1717+ description:
1818+ "AT-URI reference to the publication record being subscribed to (ex: at://did:plc:abc123/site.standard.publication/xyz789)."
1919+ }
2020+ }
2121+ },
2222+ description: "Record declaring a subscription to a publication",
2323+ key: "tid"
2424+ }
2525+ },
2626+ lexicon: 1
2727+ })
2828+end
+73
lib/atproto/site/standard/publication.ex
···11+defmodule Site.Standard.Publication do
22+ @moduledoc false
33+ use Atex.Lexicon
44+55+ deflexicon(%{
66+ id: "site.standard.publication",
77+ defs: %{
88+ main: %{
99+ type: "record",
1010+ record: %{
1111+ type: "object",
1212+ required: ["url", "name"],
1313+ properties: %{
1414+ name: %{
1515+ type: "string",
1616+ description: "Name of the publication.",
1717+ maxGraphemes: 500,
1818+ maxLength: 5000
1919+ },
2020+ description: %{
2121+ type: "string",
2222+ description: "Brief description of the publication.",
2323+ maxGraphemes: 3000,
2424+ maxLength: 30000
2525+ },
2626+ url: %{
2727+ type: "string",
2828+ format: "uri",
2929+ description:
3030+ "Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path."
3131+ },
3232+ basicTheme: %{
3333+ type: "ref",
3434+ description:
3535+ "Simplified publication theme for tools and apps to utilize when displaying content.",
3636+ ref: "site.standard.theme.basic"
3737+ },
3838+ icon: %{
3939+ type: "blob",
4040+ accept: ["image/*"],
4141+ description:
4242+ "Square image to identify the publication. Should be at least 256x256.",
4343+ maxSize: 1_000_000
4444+ },
4545+ preferences: %{
4646+ type: "ref",
4747+ description:
4848+ "Object containing platform specific preferences (with a few shared properties).",
4949+ ref: "#preferences"
5050+ }
5151+ }
5252+ },
5353+ description:
5454+ "A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings.",
5555+ key: "tid"
5656+ },
5757+ preferences: %{
5858+ type: "object",
5959+ description:
6060+ "Platform-specific preferences for the publication, including discovery and visibility settings.",
6161+ properties: %{
6262+ showInDiscover: %{
6363+ default: true,
6464+ type: "boolean",
6565+ description:
6666+ "Boolean which decides whether the publication should appear in discovery feeds."
6767+ }
6868+ }
6969+ }
7070+ },
7171+ lexicon: 1
7272+ })
7373+end
+39
lib/atproto/site/standard/theme/basic.ex
···11+defmodule Site.Standard.Theme.Basic do
22+ @moduledoc false
33+ use Atex.Lexicon
44+55+ deflexicon(%{
66+ id: "site.standard.theme.basic",
77+ defs: %{
88+ main: %{
99+ type: "object",
1010+ description:
1111+ "A simplified theme definition for publications, providing basic color customization for content display across different platforms and applications.",
1212+ required: ["background", "foreground", "accent", "accentForeground"],
1313+ properties: %{
1414+ accent: %{
1515+ type: "union",
1616+ description: "Color used for links and button backgrounds.",
1717+ refs: ["site.standard.theme.color#rgb"]
1818+ },
1919+ accentForeground: %{
2020+ type: "union",
2121+ description: "Color used for button text.",
2222+ refs: ["site.standard.theme.color#rgb"]
2323+ },
2424+ background: %{
2525+ type: "union",
2626+ description: "Color used for content background.",
2727+ refs: ["site.standard.theme.color#rgb"]
2828+ },
2929+ foreground: %{
3030+ type: "union",
3131+ description: "Color used for content text.",
3232+ refs: ["site.standard.theme.color#rgb"]
3333+ }
3434+ }
3535+ }
3636+ },
3737+ lexicon: 1
3838+ })
3939+end