diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..99130478 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,65 @@ +name: Docs Build and Deploy + +on: + push: + branches: + - main + paths: + - ".github/workflows/docs.yml" + - "requirements-docs.txt" + - "mkdocs.yml" + - "docs/**" + pull_request: + branches: + - main + paths: + - ".github/workflows/docs.yml" + - "requirements-docs.txt" + - "mkdocs.yml" + - "docs/**" + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + permissions: + contents: write + actions: read + + if: github.repository == 'google/A2UI' + + steps: + - name: Checkout Code + uses: actions/checkout@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + + - name: Configure Git Credentials + run: | + git config --global user.name github-actions[bot] + git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com + + - name: Setup Python + uses: actions/setup-python@v6 + with: + python-version: 3.13 + + - name: Restore pip cache + uses: actions/cache@v4 + with: + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-docs.txt') }} + path: ~/.cache/pip + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install documentation dependencies + run: pip install -r requirements-docs.txt + + - name: Build Documentation (PR Check) + if: github.event_name == 'pull_request' + run: mkdocs build + + - name: Deploy development version from main branch + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: | + mkdocs gh-deploy diff --git a/mkdocs.yaml b/mkdocs.yaml new file mode 100644 index 00000000..dfcb2838 --- /dev/null +++ b/mkdocs.yaml @@ -0,0 +1,124 @@ +site_name: A2UI Protocol Documentation +site_url: https://google.github.io/A2UI/ +site_description: Official documentation for the A2UI (Generative UI Language Format) protocol, a JSONL-based, streaming UI protocol designed to be easily generated by Large Language Models (LLMs). +site_author: Google +site_dir: site +edit_uri: edit/main/docs/ + +extra: + analytics: + provider: google + property: G-YX9TPV8DCC + +# Navigation +nav: + - Specification: a2ui_protocol.md + - Proposals: + - v0.8: proposals/v0_8.md + +# Repository +repo_name: A2UI +repo_url: https://github.com/google/A2UI + +# Copyright +copyright: Copyright 2025 Google. Licensed under the Apache License, Version 2.0. + +# Configuration +theme: + name: material + font: + text: Google Sans + code: Roboto Mono + icon: + repo: fontawesome/brands/github + view: material/pencil-box-multiple + admonition: + note: fontawesome/solid/note-sticky + abstract: fontawesome/solid/book + info: fontawesome/solid/circle-info + tip: fontawesome/solid/bullhorn + success: fontawesome/solid/check + question: fontawesome/solid/circle-question + warning: fontawesome/solid/triangle-exclamation + failure: fontawesome/solid/bomb + danger: fontawesome/solid/skull + bug: fontawesome/solid/robot + example: fontawesome/solid/flask + quote: fontawesome/solid/quote-left + palette: + - scheme: default + primary: teal + accent: light blue + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + - scheme: slate + primary: teal + accent: light blue + toggle: + icon: material/brightness-4 + name: Switch to light mode + + features: + - announce.dismiss + - content.action.view + - content.code.annotate + - content.code.copy + - content.code.select + - content.tabs.link + - navigation.footer + - navigation.indexes + - navigation.instant + - navigation.instant.progress + - navigation.path + - navigation.top + - navigation.tracking + - toc.follow + +# Extensions +markdown_extensions: + - meta + - footnotes + - admonition + - attr_list + - md_in_html + - pymdownx.details + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.highlight: + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite + - pymdownx.snippets: + url_download: true + dedent_subsections: true + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format + - pymdownx.tabbed: + alternate_style: true + slugify: !!python/object/apply:pymdownx.slugs.slugify + kwds: + case: lower + - pymdownx.tasklist: + custom_checkbox: true + - toc: + permalink: true + +# Plugins +plugins: + - search + - macros + - llmstxt: + full_output: llms-full.txt + sections: + "Specification": + - a2ui_protocol.md + - redirects: + redirect_maps: + 'index.md': "a2ui_protocol.md" diff --git a/requirements-docs.txt b/requirements-docs.txt new file mode 100644 index 00000000..b792c5fe --- /dev/null +++ b/requirements-docs.txt @@ -0,0 +1,4 @@ +mkdocs-material==9.6.22 +mkdocs-redirects==1.2.2 +mkdocs-macros-plugin==1.4.0 +mkdocs-llmstxt==0.4.0