Generating Chrome
Generating central catalog and chat layout configurations using the ast-chrome transtype and customizing overridable chrome elements.
Templates Overview
The ast-chrome transformation type generates the global chrome.json file. This file provides default layouts for pages and components when individual document sets do not supply custom header or footer templates via --args.hdr or --args.ftr:
dita --input=path/to/document.ditamap \
--format=ast-chrome \
--output=path/to/output
Publish the generated chrome.json to data-store via its REST API:
curl -X PUT --data-binary @path/to/output/chrome.json \
-H "Content-Type: application/json" \
http://<data-store>/api/chrome
See Publishing chrome.json in the data-store guide for authorization and validation details (AUTH_TOKEN, size limits, and error responses).
Overridable Chrome Elements
The chrome.json configuration file organizes layout templates and UI strings into overridable component blocks:
docs-page(Documentation Portal Catalog)-
title— Main heading title for the documentation catalog portal (default: "Documentation").description— Subtitle text for the catalog portal (default: "Documentation Portal").header(docs-page.header) — Fallback top navigation bar AST layout for the catalog landing page.card(docs-page.card) — Template AST node structure for individual document set cards in the landing page grid.
chat-bot(AI Assistant Portal)-
title— Title heading for the AI Assistant chat interface (default: "AI Assistant").description— Subtitle description for AI chat (default: "AI Assisted Documentation Search").header(chat-bot.header) — Top navigation header layout for the AI Assistant view, including conversation controls.card(chat-bot.card) — Welcome card layout containing initial prompt suggestions.form(chat-bot.form) — Prompt submission bar layout containing the question input field and send button.
texts(Internationalization & UI Strings)-
noResults— Text displayed when search queries yield zero results (default: "No results").tableOfContents— Label for the topic navigation sidebar (default: "Table of contents").menubarNavigation— Accessibility label for main navigation bar (default: "Menubar navigation").expand/collapse— Labels for collapsible section controls.
Chrome Include Files as Examples
The plug-in includes reference XML templates that demonstrate how chrome layout components are defined before compilation into AST format:
- chrome.content.docs-page.xml
- Defines the documentation catalog portal title, description, and the document set card template (
docs-page.card). Uses placeholders such as<document-title/>and<document-description/>to dynamically display metadata for discovered document sets. - chrome.navbar.chat-bot.xml
- Defines the header navigation bar for the AI Assistant chat portal (
chat-bot.header). Includes a Clear Chat button assigned@role="clear-chat"to reset conversation context, and a theme switcher button assigned@role="theme-toggle". - chrome.content.chat-bot.xml
- Defines the AI Assistant welcome card (
chat-bot.card) with quick prompt action buttons, as well as the submission form layout (chat-bot.form) containing the prompt input field (@id="user-input") and send button (@id="send-btn").