DaypressLayout AST Schema, HTML5 Transpiler & 37 Widgets
Every visual page and template in Daypress is stored as a strongly-typed JSON document (DaypressLayout) validated by crates/daypress-ast. You can author layouts visually, import full HTML5/CSS documents, or mutate the AST JSON directly.
Fastest path: Zero-fallback HTML5/CSS transpiler
Pass any complete, responsive HTML5 + <style> document to daypress_import_html_design (or use DayStudio's Import HTML modal). Daypress parses CSS rules, media queries, Flexbox/Grid containers, cards, tabs, <details> accordions, and <form> tags into 100% native AST nodes (custom_html_nodes: 0):
// MCP: daypress_import_html_design
{
"title": "Home",
"slug": "home",
"post_type": "page",
"status": "publish",
"set_as_front_page": true,
"extract_header_footer": true, // Saves <header> and <footer> as global Theme Templates!
"html": "<!DOCTYPE html><html><head><style>...</style></head><body><header>...</header><main><section>...</section></main><footer>...</footer></body></html>"
}Canonical DaypressLayout JSON structure
Read any page's AST with daypress_get_post_layout and save precision edits with daypress_update_post_layout:
{
"version": 1,
"global_styles": { "content_width": 1160, "custom_css": "" },
"root": {
"id": "root",
"type": "Root",
"styles": {},
"children": [
{
"id": "hero_sec",
"type": "Section",
"styles": {
"background_color": "var(--paper)",
"padding_top": "72px",
"padding_bottom": "72px"
},
"children": [
{
"id": "hero_wrap",
"type": "Container",
"styles": {
"max_width": "1160px",
"margin_left": "auto",
"margin_right": "auto",
"display": "grid",
"grid_template_columns": "repeat(2, minmax(0, 1fr))",
"gap": "40px",
"tablet": { "grid_template_columns": "1fr" }
},
"children": [
{
"id": "hero_h1",
"type": "Heading",
"data": { "level": 1, "text": "Precision Rust publishing." },
"styles": { "font_family": "var(--serif)", "text_color": "var(--ink)" }
}
]
}
]
}
]
}
}Complete 37-widget DayStudio AST catalog
| Group | Node type Variants | Key data Properties |
|---|---|---|
Layout (6) | Root, Section, Container, Column, Grid, Flex | tag / html_tag (section, header, nav, article, aside, footer), columns, gap. |
Editorial (7) | Heading, Text, Button, Spacer, Divider, Icon, IconList | level (1..6), text, content_html, url, target, icon, items. |
Media & Boxes (6) | Image, Video, Audio, Map, IconBox, ImageBox | src (/uploads/...), alt, width, height, poster, controls, title, description. |
Interactive & Conversion (10) | Tabs, Accordion, PriceCard, CallToAction, Testimonial, TestimonialCarousel, Counter, Benchmark, ProgressBar, Countdown, AnimatedHeadline | items: [{"title", "content"}] (Accordion auto-emits FAQPage JSON-LD), price, features, slides. |
Dynamic CMS (8) | LoopGrid, NavMenu, Form, LanguageSwitcher, TableOfContents, Breadcrumbs, SearchForm, SymbolInstance | post_type, taxonomy, menu_location, form_id, display_style, symbol_id, overrides. |