--- name: qna-markup description: Write, edit, review or convert content into QnA Markup, the plain-text language (Q:, A:, X:, DOC:, GOTO:) that www.qnamarkup.org turns into interactive question-and-answer interviews, guided forms, decision trees and document assemblers. Use whenever someone asks for "a QnA", QnA Markup, an interactive interview or decision tree they can run in a browser, or asks to encode a process, checklist, policy, FAQ or document as questions and answers. --- # QnA Markup QnA Markup is a plain-text language. A `.txt` file of it, pasted into the editor at https://www.qnamarkup.org/, becomes a chat-style interview: the visitor is shown one question at a time, answers by clicking a button or typing, and is led down a branch you wrote. It was made for legal-aid style guided interviews, but it is a general decision-tree / guided-form language. ## What to produce Produce **plain text**, indented with **tabs**, saved or offered as a `.txt` file (or shown in a code block). Never a table, never Markdown bullets, never HTML around it. A minimal QnA: ``` Title: Is it a weekend? Q: What day is it? A: Saturday Q: Then it's the weekend. A: Sunday Q: Then it's the weekend. A: Something else Q: Then it's a weekday. ``` ## Workflow 1. **Understand the process** before writing. Find the decision points (each becomes a `Q` with `A` buttons), the facts to collect (each an `X` text field), the outcomes (leaf questions with no answers), and any text to generate (`DOC:`). Ask the person, briefly, if something essential is unclear; otherwise make sensible assumptions and say what they were. 2. **Draft the tree.** One question per `Q`. Answer buttons phrased as answers ("Yes", "Under 18", "I rent"), not as questions. Every path must end somewhere sensible (a closing `Q` with no answers, or a `GOTO` to one). Give every question that anything jumps to a name: `Q(rent):`. 3. **Check it against the rules below** (indentation, alternation, GOTO placement, unique names). If `scripts/check.js` is available, run `node scripts/check.js file.txt`; it prints the interpreter's own error messages with line numbers, or `OK`. 4. **Hand it over** with one line on how to run it: paste into https://www.qnamarkup.org/ (or open `https://www.qnamarkup.org/?source=URL` when the file is on the web with CORS enabled), then use *Update Outputs*, *Link* or *HTML* to share it. ## The rules that matter (the interpreter enforces them) **Tags** start a line (after indentation) and end with a colon: | tag | meaning | |---|---| | `Title:` `Author:` `Description:` | header, before the first `Q`; shown under *credits* | | `Before:` `After:` | HTML (and `