.do

MDX.as

Instant preview and deployment for MDXLD documents

MDX.as

MDX.as provides instant preview and deployment for MDXLD documents - publish your content with a single command and get a live URL immediately.

What is MDX.as?

MDX.as is the fastest way to preview and share MDXLD documents:

  • Instant Preview: Deploy and preview in seconds
  • Custom Domains: Use .as subdomain or custom domain
  • Zero Configuration: No setup required
  • Type-Aware Rendering: Automatically renders based on $type
  • Live Updates: Changes deploy instantly
  • Public or Private: Control access with authentication
  • Analytics: Built-in analytics and metrics

URL Patterns

Output + Custom URL: mdx.as/:output/:url

Preview with custom output format and URL:

Where:

  • :output - Output format (page, site, agent, app, api, sdk, docs, landing-page, waitlist, service)
  • :url - Custom URL path

Output + Database Structure: mdx.as/:output/:domain/:type/:id

Preview documents from the platform database:

Where:

  • :output - Output format
  • :domain - The domain/namespace from database
  • :type - Document $type
  • :id - Document $id

Document Resolution

When you access mdx.as/:output/:url, the platform:

  1. Checks URL field: Looks for exact match in url field
  2. Checks path structure: Falls back to domain/type/id resolution
  3. Renders output: Applies output format template
  4. Returns preview: Live preview with the specified output

Preview Shortcut Aliases

Each output format has a convenient shortcut domain that's an alias for mdx.as/:output/:

  • agents.asmdx.as/agent/
  • page.asmdx.as/page/
  • site.asmdx.as/site/
  • service.asmdx.as/service/
  • apps.asmdx.as/app/
  • apis.asmdx.as/api/
  • sdk.asmdx.as/sdk/
  • docs.asmdx.as/docs/
  • landing-page.asmdx.as/landing-page/
  • waitlist.asmdx.as/waitlist/

Examples:

All shortcut domains support both URL patterns:

  • [output].as/:url (custom URL)
  • [output].as/:domain/:type/:id (database structure)

Output Formats

page.as - Single Pages

Preview individual pages:

---
$type: WebPage
$context: https://schema.org
name: About Us
url: /about
---

# About Us

We are building...

Preview:

  • Custom URL: https://mdx.as/page/about
  • Database: https://mdx.as/page/company.do/WebPage/about-us

site.as - Full Sites

Preview complete sites:

---
$type: WebSite
$context: https://schema.org
name: Portfolio
domain: portfolio.do
---

# My Portfolio

Welcome to my work...

Preview:

  • Custom URL: https://mdx.as/site/portfolio
  • Database: https://mdx.as/site/portfolio.do/WebSite/main

agent.as - AI Agents

Preview AI agent interfaces:

---
$type: Agent
$context: https://schema.org.ai
name: Customer Support Agent
domain: support.do
---

# Customer Support

How can I help you today?

Preview:

  • Custom URL: https://mdx.as/agent/support
  • Database: https://mdx.as/agent/support.do/Agent/customer-service

app.as - Applications

Preview applications:

---
$type: WebApplication
$context: https://schema.org
name: Task Manager
url: /tasks
---

# Task Manager

Manage your tasks...

Preview:

  • Custom URL: https://mdx.as/app/tasks
  • Database: https://mdx.as/app/productivity.do/WebApplication/task-manager

api.as - API Documentation

Preview API docs:

---
$type: APIReference
$context: https://schema.org
name: REST API
domain: api.do
---

# REST API

Our API provides...

Preview:

  • Custom URL: https://mdx.as/api/rest
  • Database: https://mdx.as/api/api.do/APIReference/rest-api

sdk.as - SDK Documentation

Preview SDK docs:

---
$type: SoftwareSourceCode
$context: https://schema.org
name: TypeScript SDK
url: /sdk/typescript
---

# TypeScript SDK

Install our SDK...

Preview:

  • Custom URL: https://mdx.as/sdk/typescript
  • Database: https://mdx.as/sdk/developers.do/SoftwareSourceCode/typescript-sdk

docs.as - Documentation

Preview documentation:

---
$type: Documentation
$context: https://schema.org
name: User Guide
url: /docs/getting-started
---

# Getting Started

Welcome to the guide...

Preview:

  • Custom URL: https://mdx.as/docs/getting-started
  • Database: https://mdx.as/docs/help.do/Documentation/getting-started

landing-page.as - Landing Pages

Preview landing pages:

---
$type: LandingPage
$context:
  - https://schema.org
  - https://schema.org.ai
name: Product Launch
url: /launch
hero:
  headline: Build Amazing Products
---

Preview:

  • Custom URL: https://mdx.as/landing-page/launch
  • Database: https://mdx.as/landing-page/marketing.do/LandingPage/product-launch

waitlist.as - Waitlist Pages

Preview waitlist pages:

---
$type: WaitlistPage
$context: https://schema.org.ai
name: Beta Access
url: /beta
---

# Get Early Access

Sign up for beta...

Preview:

  • Custom URL: https://mdx.as/waitlist/beta
  • Database: https://mdx.as/waitlist/launch.do/WaitlistPage/beta-signup

service.as - Services

Preview service pages:

---
$type: Service
$context: https://schema.org
name: Image Optimization
url: /services/images
---

# Image Optimization

Optimize images on the fly...

Preview:

  • Custom URL: https://mdx.as/service/images
  • Database: https://mdx.as/service/cdn.do/Service/image-optimizer

Quick Start

Deploy from CLI

# Deploy with custom URL
mdxe deploy blog-post.mdx --target as --url /posts/hello-world

# Deploy with domain/type/id
mdxe deploy blog-post.mdx --target as --domain blog.do

# Deploy with output format
mdxe deploy landing.mdx --target as --output landing-page --url /launch

Deploy from Web

  1. Visit mdx.as
  2. Drag and drop your MDX file
  3. Choose output format
  4. Get instant preview URL

Deploy from Platform

# Deploy by domain/type/id
mdxe deploy --platform blog.do/BlogPost/my-post --target as

# Deploy by custom URL
mdxe deploy --platform /posts/hello-world --target as --output page

Features

Instant Deployment

Deploy in seconds:

mdxe deploy --target as --url /mypage
# ✓ Deployed to https://mdx.as/page/mypage in 2.3s

Live Updates

Changes deploy automatically:

mdxe deploy --target as --watch --url /mypage
# Watching for changes...
# ✓ Updated https://mdx.as/page/mypage

Type-Aware Rendering

Automatically renders based on $type:

  • BlogPost → Blog layout
  • LandingPage → Landing page layout
  • Documentation → Docs layout
  • Agent → Agent interface

Custom Themes

Apply custom themes:

mdxe deploy --target as --theme dark --url /mypage
mdxe deploy --target as --theme custom.json --url /mypage

Access Control

Control who can view:

# Public (default)
mdxe deploy --target as --public --url /mypage

# Private (requires auth)
mdxe deploy --target as --private --url /mypage

# Password protected
mdxe deploy --target as --password mysecret --url /mypage

Analytics

Built-in analytics:

  • Page views: Track visits
  • Geographic data: See where visitors are from
  • Referrers: Know how people found you
  • Devices: Desktop vs mobile
  • Real-time: Live visitor count

View analytics:

Configuration

Deploy Config

Create .mdx/deploy.json:

{
  "target": "as",
  "output": "page",
  "url": "/my-project",
  "theme": "dark",
  "access": "public",
  "analytics": true
}

Deploy with config:

mdxe deploy

API

Deployment API

Deploy programmatically:

import { deploy } from 'mdxe'

const result = await deploy({
  target: 'as',
  output: 'page',
  url: '/my-project',
  files: ['blog-post.mdx'],
  public: true
})

console.log(`Deployed to: ${result.url}`)
// https://mdx.as/page/my-project

Preview API

Get preview info:

import { getPreview } from 'mdxe'

const preview = await getPreview('mdx.as/page/my-project')

console.log(preview.views)      // Page views
console.log(preview.visitors)   // Unique visitors
console.log(preview.updated)    // Last updated

Best Practices

  1. Use custom URLs: For human-readable paths
  2. Choose right output: Match output format to $type
  3. Add analytics: Track visitor metrics
  4. Set access control: Use private for sensitive content
  5. Custom themes: Brand your previews
  6. Live updates: Use watch mode during development
  7. Clean up: Delete unused previews
  8. Environment variables: Keep secrets in env vars

Resources