# Documents

Document artifacts are the most common artifact type in DarcyIQ. Ask Darcy to write, format, or structure any text-based content and it produces an editable document artifact you can refine, export, and save.

## Supported Formats

| Format       | Best For                                            | Editor                       |
| ------------ | --------------------------------------------------- | ---------------------------- |
| **Markdown** | Reports, summaries, proposals, formatted documents  | Rich text (MDX)              |
| **Text**     | Plain notes, logs, unformatted content              | Monospace text               |
| **HTML**     | Web content, email templates, rich formatting       | Split-pane with live preview |
| **JSON**     | Structured data, configuration files, API responses | Code editor with validation  |
| **XML**      | Data structures, configuration, SOAP payloads       | Code editor                  |

Darcy automatically picks the best format based on your request. If you want a specific format, just say so — for example, "Create this as HTML" or "Give me the raw JSON."

## Creating Documents

Ask Darcy naturally:

* "Write a project status report for Q1"
* "Draft a follow-up email to the client"
* "Create an HTML email template for our newsletter"
* "Format this data as JSON"

## Editing

Click **Edit** to modify the document directly in the artifact panel. Each format has its own editor:

* **Markdown**: Rich text editor with formatting toolbar
* **HTML**: Side-by-side code and live preview
* **JSON**: Code editor with syntax validation — invalid JSON is flagged before you can save
* **Text / XML**: Monospace code editor

You can also ask Darcy to make changes in chat. Darcy uses targeted find-and-replace edits, so only the parts you want changed are updated while the rest of the document stays intact.

## Export Options

| Format   | Export Options                               |
| -------- | -------------------------------------------- |
| Markdown | Markdown file, PDF, DOCX, DOCX with template |
| Text     | Text file, PDF                               |
| HTML     | HTML file, PDF                               |
| JSON     | JSON file, PDF                               |
| XML      | XML file, PDF                                |

Markdown documents have the richest export support, including **DOCX with template** — upload a Word template and Darcy will apply your branding and styles to the export.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.darcyiq.com/core-features/artifacts/documents.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
