Skip to content

Commit 47aa1e6

Browse files
committed
Reorganize docs to keep 0.8 and 0.9 separate.
docs: add mkdocs-redirects to requirements Fixes CI build error by adding missing dependency `mkdocs-redirects`, which is used in `mkdocs.yaml` for URL redirection.
1 parent 057fa2a commit 47aa1e6

File tree

116 files changed

+12422
-255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+12422
-255
lines changed

docs/index.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,17 @@ A2UI enables AI agents to generate rich, interactive user interfaces that render
2727
> foster collaboration, gather feedback, and solicit contributions (e.g., on client renderers).
2828
> Expect changes.
2929
30+
**Documentation Versions:**
31+
32+
This site hosts documentation for:
33+
34+
- **[v0.8 (Previous)](v0.8/quickstart.md)**: The previous stable version, available for reference.
35+
- **[v0.9 (Current)](v0.9/quickstart.md)**: The current specification.
36+
- **[v0.10 (Draft)](v0.10/specification/docs/v0.10-a2ui.md)**: The draft of the next specification.
37+
3038
## At a Glance
3139

32-
A2UI is currently [v0.9](specification/v0.9-a2ui.md),
40+
A2UI is currently [v0.9](v0.9/specification/docs/v0.9-a2ui.md),
3341
Apache 2.0 licensed,
3442
created by Google with contributions from CopilotKit and the open source community,
3543
and is in active development [on GitHub](https://github.com/google/A2UI).
@@ -39,10 +47,10 @@ The problem A2UI solves is: **how can AI agents safely send rich UIs across trus
3947
Instead of text-only responses or risky code execution, A2UI lets agents send **declarative component descriptions** that clients render using their own native widgets. It's like having agents speak a universal UI language.
4048

4149
In this repo you will find
42-
[A2UI specifications](specification/v0.9-a2ui.md)
50+
[A2UI specifications](v0.9/specification/docs/v0.9-a2ui.md)
4351
and implementations for
44-
[renderers](renderers.md) (eg: Angular, Flutter, etc.) on the client side,
45-
and [transports](transports.md) (eg: A2A, etc.) which communicate A2UI messages between agents and clients.
52+
[renderers](v0.9/renderers.md) (eg: Angular, Flutter, etc.) on the client side,
53+
and [transports](v0.9/transports.md) (eg: A2A, etc.) which communicate A2UI messages between agents and clients.
4654

4755
<div class="grid cards" markdown>
4856

@@ -76,37 +84,37 @@ and [transports](transports.md) (eg: A2A, etc.) which communicate A2UI messages
7684

7785
<div class="grid cards" markdown>
7886

79-
- :material-clock-fast:{ .lg .middle } **[Quickstart Guide](quickstart.md)**
87+
- :material-clock-fast:{ .lg .middle } **[Quickstart Guide](v0.9/quickstart.md)**
8088

8189
---
8290

8391
Run the restaurant finder demo and see A2UI in action with Gemini-powered agents.
8492

85-
[:octicons-arrow-right-24: Get started](quickstart.md)
93+
[:octicons-arrow-right-24: Get started](v0.9/quickstart.md)
8694

87-
- :material-book-open-variant:{ .lg .middle } **[Core Concepts](concepts/overview.md)**
95+
- :material-book-open-variant:{ .lg .middle } **[Core Concepts](v0.9/concepts/overview.md)**
8896

8997
---
9098

9199
Understand surfaces, components, data binding, and the adjacency list model.
92100

93-
[:octicons-arrow-right-24: Learn concepts](concepts/overview.md)
101+
[:octicons-arrow-right-24: Learn concepts](v0.9/concepts/overview.md)
94102

95-
- :material-code-braces:{ .lg .middle } **[Developer Guides](guides/client-setup.md)**
103+
- :material-code-braces:{ .lg .middle } **[Developer Guides](v0.9/guides/client-setup.md)**
96104

97105
---
98106

99107
Integrate A2UI renderers into your app or build agents that generate UIs.
100108

101-
[:octicons-arrow-right-24: Start building](guides/client-setup.md)
109+
[:octicons-arrow-right-24: Start building](v0.9/guides/client-setup.md)
102110

103-
- :material-file-document:{ .lg .middle } **[Protocol Reference](specification/v0.9-a2ui.md)**
111+
- :material-file-document:{ .lg .middle } **[Protocol Reference](v0.9/specification/docs/v0.9-a2ui.md)**
104112

105113
---
106114

107115
Dive into the complete technical specification and message types.
108116

109-
[:octicons-arrow-right-24: Read the spec](specification/v0.9-a2ui.md)
117+
[:octicons-arrow-right-24: Read the spec](v0.9/specification/docs/v0.9-a2ui.md)
110118

111119
</div>
112120

docs/introduction/faq.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Frequently Asked Questions
2+
3+
## General
4+
5+
### What is the difference between v0.8 and v0.9?
6+
**v0.8** is the previous stable version of the A2UI specification. It is preserved for reference for existing implementations.
7+
**v0.9** is the current version, introducing significant improvements such as the "Prompt-First" design, better streaming support, and decoupled architecture. We recommend all new projects start with v0.9.
8+
9+
### Can I mix versions?
10+
No, A2UI versions are distinct. An agent speaking v0.9 should communicate with a client supporting v0.9. The protocol version is negotiated or specified in the message envelope.
11+
12+
### Where can I find the v0.8 documentation?
13+
You can access the [v0.8 documentation](../v0.8/quickstart.md) via the navigation menu under "Specifications > v0.8" or by browsing the v0.8 section in the sidebar.

docs/introduction/how-to-use.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ npm install @a2ui/angular
2424

2525
Connect to agent messages (SSE, WebSockets, or A2A) and customize styling to match your brand.
2626

27-
**Next:** [Client Setup Guide](../guides/client-setup.md) | [Theming](../guides/theming.md)
27+
**Next:** [Client Setup Guide](../v0.9/guides/client-setup.md) | [Theming](../v0.9/guides/theming.md)
2828

2929
---
3030

@@ -39,7 +39,7 @@ Create an agent that generates A2UI responses for any compatible client.
3939

4040
Include the A2UI schema in your LLM prompts, generate JSONL messages, and stream to clients over SSE, WebSockets, or A2A.
4141

42-
**Next:** [Agent Development Guide](../guides/agent-development.md)
42+
**Next:** [Agent Development Guide](../v0.9/guides/agent-development.md)
4343

4444
---
4545

docs/introduction/where-is-it-used.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,16 @@ The A2UI community is building exciting projects:
134134

135135
### Community Contributions
136136

137-
Have you built something with A2UI? [Share it with the community!](../community.md)
137+
Have you built something with A2UI? [Share it with the community!](../v0.9/community.md)
138138

139139
---
140140

141141
## Next Steps
142142

143-
- [Quickstart Guide](../quickstart.md) - Try the demo
144-
- [Agent Development](../guides/agent-development.md) - Build an agent
145-
- [Client Setup](../guides/client-setup.md) - Integrate a renderer
146-
- [Community](../community.md) - Join the community
143+
- [Quickstart Guide](../v0.9/quickstart.md) - Try the demo
144+
- [Agent Development](../v0.9/guides/agent-development.md) - Build an agent
145+
- [Client Setup](../v0.9/guides/client-setup.md) - Integrate a renderer
146+
- [Community](../v0.9/community.md) - Join the community
147147

148148
---
149149

docs/introduction/who-is-it-for.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Build multi-agent platforms, enterprise assistants, or cross-platform apps where
1616
- Cross-platform: web, mobile, desktop
1717
- Interoperable: open source, same spec with multiple renderers
1818

19-
**Get started:** [Client Setup](../guides/client-setup.md) | [Theming](../guides/theming.md) | [Custom Components](../guides/custom-components.md)
19+
**Get started:** [Client Setup](../v0.9/guides/client-setup.md) | [Theming](../v0.9/guides/theming.md) | [Custom Components](../v0.9/guides/custom-components.md)
2020

2121
### 2. Agent Developers (Backend/AI)
2222

@@ -30,7 +30,7 @@ Build agents that generate forms, dashboards, and interactive workflows.
3030
- Portable: one agent response works across all A2UI clients
3131
- Streamable: progressive rendering as you generate
3232

33-
**Get started:** [Agent Development](../guides/agent-development.md)
33+
**Get started:** [Agent Development](../v0.9/guides/agent-development.md)
3434

3535
### 3. Platform Builders (SDK Creators)
3636

@@ -46,7 +46,7 @@ Do you ship your agent into other apps you don't necessarily control?
4646
- Extensible: custom component catalogs
4747
- Open source (Apache 2.0)
4848

49-
**Get started:** [Community](../community.md) | [Roadmap](../roadmap.md)
49+
**Get started:** [Community](../v0.9/community.md) | [Roadmap](../v0.9/roadmap.md)
5050

5151
---
5252

docs/scripts/README.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,18 @@
22

33
This directory contains utility scripts to prepare our documentation for the **MkDocs** build process.
44

5-
## Purpose
5+
## Alert/Admonition Conversion (`convert_docs.py`)
66

7-
To ensure a great reading experience both on GitHub and the hosted site, we use **GitHub-flavored Markdown** as our primary source of truth. This script transforms GitHub's native syntax into **MkDocs-compatible syntax** (specifically for the `pymdown-extensions`) during the build pipeline.
7+
### Purpose
88

9-
## Supported Conversions (Uni-directional)
9+
To ensure a great reading experience both on GitHub and the hosted site, we use **GitHub-flavored Markdown** as our primary source of truth. This script transforms GitHub's native syntax into **MkDocs-compatible syntax** (specifically for the `pymdown-extensions`) during the build pipeline.
1010

1111
The script performs a uni-directional transformation: **GitHub Markdown → MkDocs Syntax**.
1212

13-
### Alert/Admonition Conversion
14-
1513
- GitHub uses a blockquote-based syntax for alerts.
1614
- MkDocs requires the `!!!` or `???` syntax to render colored callout boxes.
1715

18-
## Running the Conversion
16+
### Running the Conversion
1917

2018
The conversion is run as part of the build pipeline. No additional steps are required. If you need to run the conversion manually, you can run the `convert_docs.py` script in the repository root.
2119

@@ -37,3 +35,35 @@ python docs/scripts/convert_docs.py
3735
!!! warning "Attention"
3836
This is an alert.
3937
```
38+
39+
## Specification Preparation (`prepare_docs.py`)
40+
41+
This script prepares the raw specification files for the build.
42+
43+
### Purpose
44+
45+
- **Copies Source Files**: Moves specs from `specification/v0_X` to `docs/v0.X/specification`.
46+
- **Flattens JSON**: Moves JSON files to the root of the versioned spec directory.
47+
- **Rewrites Links**: Adjusts internal links to work in the new location.
48+
49+
### Usage
50+
51+
```bash
52+
python docs/scripts/prepare_docs.py
53+
```
54+
55+
## Wrapper Migration (`migrate_wrappers.py`)
56+
57+
This script manages the "wrapper" files that include the raw specification content.
58+
59+
### Purpose
60+
61+
- **Generates Wrappers**: Reads templates from `docs/wrappers_source/`.
62+
- **Updates Includes**: Rewrites `--8<--` includes to point to the `prepare_docs.py` output.
63+
- **Fixes Cross-Version Links**: Ensures links between different versions (e.g. v0.9 -> v0.8) are correct.
64+
65+
### Usage
66+
67+
```bash
68+
python docs/scripts/migrate_wrappers.py
69+
```

docs/scripts/migrate_wrappers.py

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
2+
import os
3+
import shutil
4+
import re
5+
6+
"""
7+
Generates and migrates "wrapper" Markdown files for the A2UI specification documentation.
8+
9+
This script manages the documentation pages that wrap the raw specification content:
10+
1. **Generates Wrappers**: Reads template/wrapper files from `docs/wrappers_source/`. These files contain metadata headers and include directives (e.g., `--8<--`) that pull in the raw specification content prepared by `prepare_docs.py`.
11+
2. **Version Filtering**: Identifies which version each wrapper corresponds to based on its filename (e.g., `v0.9-a2ui.md` belongs to `v0.9`).
12+
3. **Updates Include Paths**: Dynamically rewrites the include directives to point to the correct location of the raw specification files in the build directory (e.g., changing `docs/specification/v0_9/...` to `docs/v0.9/specification/...`).
13+
4. **Fixes Cross-Version Links**: Rewrites links within the wrapper files to ensure they point to the correct versioned documentation pages. For example, it converts links like `(v0.8-a2ui.md)` to relative paths like `(../../../v0.8/specification/docs/v0.8-a2ui.md)` when linking across versions.
14+
5. **Deploys to Documentation**: Places the processed wrapper files into the appropriate versioned specification directory (e.g., `docs/v0.9/specification/docs/`).
15+
16+
Usage:
17+
Run this script after `prepare_docs.py` and before `mkdocs build`.
18+
`python3 docs/scripts/migrate_wrappers.py`
19+
"""
20+
21+
def migrate_wrappers(repo_root):
22+
source_dir = os.path.join(repo_root, 'docs', 'wrappers_source')
23+
24+
if not os.path.exists(source_dir):
25+
print(f"Source dir {source_dir} does not exist.")
26+
return
27+
28+
files = [f for f in os.listdir(source_dir) if f.endswith('.md')]
29+
30+
for filename in files:
31+
version = None
32+
if filename.startswith('v0.8'):
33+
version = 'v0.8'
34+
elif filename.startswith('v0.9'):
35+
version = 'v0.9'
36+
elif filename.startswith('v0.10'):
37+
version = 'v0.10'
38+
39+
if not version:
40+
continue
41+
42+
dest_dir = os.path.join(repo_root, 'docs', version, 'specification', 'docs')
43+
if not os.path.exists(dest_dir):
44+
os.makedirs(dest_dir, exist_ok=True)
45+
46+
source_path = os.path.join(source_dir, filename)
47+
dest_path = os.path.join(dest_dir, filename)
48+
49+
with open(source_path, 'r') as f:
50+
content = f.read()
51+
52+
# Update include paths
53+
# Old: "docs/specification/v0_8/docs/..."
54+
# New: "docs/v0.8/specification/docs/..."
55+
# Note the underscore to dot change for versions in the path if needed
56+
# The snippet path needs to match where the file ACTUALLY is relative to mkdocs root (repo root usually)
57+
58+
# Regex for includes
59+
# --8<-- "docs/specification/v0_([0-9]+)/
60+
# Replace with docs/v0.\1/specification/
61+
content = re.sub(r'docs/specification/v0_(\d+)/', r'docs/v0.\1/specification/', content)
62+
63+
# Update links
64+
# We need to fix links to other versions.
65+
# Links usually look like: (v0.8-a2ui.md)
66+
67+
def link_replacer(match):
68+
link_target = match.group(1) # e.g. v0.8-a2ui.md
69+
if link_target.startswith(version):
70+
return f"({link_target})" # Same version, same dir
71+
72+
# Different version
73+
target_ver = link_target.split('-')[0] # v0.8
74+
return f"(../../../{target_ver}/specification/docs/{link_target})"
75+
76+
content = re.sub(r'\((v0\.\d+-[^)]+\.md)\)', link_replacer, content)
77+
78+
with open(dest_path, 'w') as f:
79+
f.write(content)
80+
81+
print(f"Migrated {filename} into {dest_path}")
82+
# os.remove(source_path) # verify first
83+
84+
85+
def main():
86+
repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
87+
migrate_wrappers(repo_root)
88+
89+
90+
if __name__ == '__main__':
91+
main()

0 commit comments

Comments
 (0)