# plotwork export

> Page: https://docs.plotwork.dev/cli/commands/export. Index of every page: https://docs.plotwork.dev/llms.txt

Print paste-ready text of the first diagram for Confluence or Notion. It is a command of the Plotwork command line, the npm package `@buun_group/plotwork`.

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Print paste-ready text of the first diagram for Confluence or Notion. |
| How do I run it? | `npx -y @buun_group/plotwork@0.1.0 export`, or `plotwork export` once the package is installed. |
| What does it write? | The SVG beside the output when there is no `--image`; the text with `--out`. |
| Does it use the network? | No. It reads and writes files on this machine only. |
| Does it read the repository settings? | No. |
| How do I read this in a terminal? | `plotwork export --help` |

## Synopsis

```sh
plotwork export <file> --format confluence|confluence-wiki|notion [--image <https link>] [--out <file>] [--theme light|dark] [--no-source]
```

## What it does

Writes the first diagram of a file as text to paste into a wiki page. With `--image` the text shows the picture at that address, such as a hosted link; without it the SVG is written beside the output for you to upload, and the text names that file.

The text goes to standard output or `--out`, and the steps around the paste go to standard error.

## Options

| Option | Default | What it does |
|---|---|---|
| `--format confluence\|confluence-wiki\|notion` | Required | The wiki to write for. |
| `--image <https link>` | the SVG is written beside the output | An https address the wiki can fetch the picture from. |
| `--out <file>` | standard output | Write the text to a file. |
| `--theme light\|dark` | `light` | The colours of the SVG written beside the output. |
| `--no-source` | the source is included | Leave the diagram source out of the text. |

## Examples

Text for a Notion page, with the SVG written beside it to upload.

```sh
plotwork export checkout.diagram --format notion
```

Text for Confluence that shows a hosted picture.

```sh
plotwork export flow.diagram --format confluence --image https://cdn.plotwork.dev/d/<token>.svg
```

## Exit codes

| Code | When |
|---|---|
| `0` | The text was printed or written. |
| `1` | The diagram has an error. |
| `2` | A mistake in the command line: an unknown option, a missing operand, a file or glob that matches nothing, or a settings file that cannot be read. Also when `--format` is missing or `--image` is not an https address. |

## See also

| Doc | Why |
|---|---|
| [Command reference](https://docs.plotwork.dev/cli/commands.md) | Every command of the command line |
| [Slack, email, Confluence, and Notion](https://docs.plotwork.dev/wikis-and-chat.md) | Pasting a diagram into a wiki |
| [Exit codes and output formats](https://docs.plotwork.dev/cli/exit-codes-and-output.md) | What every code and format means |
