···11# Typelex Docs
2233-This guide maps atproto Lexicon JSON syntax to typelex (a [TypeSpec](https://typespec.io/) emitter). It assumes you're familiar with Lexicon and want to understand how to express it in TypeSpec. Consult [TypeSpec docs](https://typespec.io/) on details of TypeSpec syntax.
33+This maps [atproto Lexicon](https://atproto.com/specs/lexicon) JSON syntax to typelex (which is a [TypeSpec](https://typespec.io/) emitter). It assumes you're familiar with Lexicon and want to understand how to express it in TypeSpec. Consult [TypeSpec docs](https://typespec.io/) on details of TypeSpec syntax.
4455-Btw, this page was mostly written by Claude. I hope it's mostly correct and comprehensible.
55+This page was mostly written by Claude based on the test fixtures from this repo (which are [deployed in the playground](https://playground.typelex.org/)). I hope it's mostly correct and comprehensible. When in doubt, refer to those fixtures.
6677## Playground
8899-Go to https://typelex-playground.pages.dev/ to play with a bunch of lexicons.
99+Go to https://playground.typelex.org/ to play with a bunch of lexicons.
10101111## Quick Start
1212
+8-4
README.md
···11# typelex
2233-An experimental TypeSpec emitter for Lexicon.
33+An experimental [TypeSpec](https://typespec.io/) emitter for [Lexicon](https://atproto.com/specs/lexicon).
4455See https://typelex.pages.dev/
66+77+**This is a hobby project but maybe somebody will find it helpful.**
88+99+Design is not final and might change. Ideas welcome.
610711## Playground
81299-See https://typelex-playground.pages.dev/
1313+See https://playground.typelex.org/
10141111-## Reference
1515+## Documentation
12161313-See [DOCS.md](./DOCS.md)
1717+No "proper" docs yet. See [DOCS.md](./DOCS.md) for now.
14181519## License
1620
···11# Typelex Website
2233-Landing page for typelex - TypeSpec for AT Protocol Lexicons.
44-55-## Features
66-77-- **Live Examples**: TypeSpec examples are compiled during build to show real Lexicon JSON output
88-- **Syntax Highlighting**: Using Shiki for beautiful code highlighting
99-- **Interactive Playground**: Try typelex in the browser (coming soon)
33+Source for https://typelex.org/
104115## Development
126···17111812## Building
19132020-The build process automatically:
2121-1. Compiles TypeSpec examples **in memory** during the Astro build
2222-2. Reads TypeSpec source files
2323-3. Syntax-highlights and displays them side-by-side with generated JSON
2424-2514```sh
2615pnpm run build
2716```
28172929-No intermediate files are generated - everything happens in memory!
3030-3131-## Adding Examples
3232-3333-1. Create a new `.tsp` file in `src/examples/`
3434-2. Add it to the examples array in `src/pages/index.astro`
3535-3. Run `pnpm run build` to see it on the site
3636-3737-## Commands
3838-3939-| Command | Action |
4040-| :------------------------ | :----------------------------------------------- |
4141-| `pnpm install` | Installs dependencies |
4242-| `pnpm dev` | Starts local dev server at `localhost:4321` |
4343-| `pnpm build` | Build your production site to `./dist/` |
4444-| `pnpm preview` | Preview your build locally, before deploying |
4545-4646-## Structure
4747-4848-```
4949-/
5050-├── src/
5151-│ ├── examples/ # TypeSpec examples
5252-│ │ ├── profile.tsp
5353-│ │ ├── getQuotes.tsp
5454-│ │ └── ...
5555-│ ├── pages/
5656-│ │ └── index.astro # Landing page
5757-│ ├── components/
5858-│ │ └── Playground.tsx
5959-│ └── utils/
6060-│ └── compile.ts # In-memory TypeSpec compiler
6161-└── package.json
6262-```
···11import lzutf8 from 'lzutf8';
2233-const PLAYGROUND_BASE_URL = 'https://typelex-playground.pages.dev/';
33+const PLAYGROUND_BASE_URL = 'https://playground.typelex.org/';
4455/**
66 * Encodes TypeSpec code to a playground URL using the same compression