> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Pandoc Import and Export

> Import and export documents with Pandoc on a Kubernetes deployment.

Pandoc conversions are run by the **clsi** service of every Ayakaleaf Pro pod, like compiles: clsi asks the Docker Engine of the node to start a container from `PANDOC_IMAGE`. The **web** service shows the import and export menus. What the feature does and how to build the image is described in [Pandoc Import and Export](https://ayakaleaf-pro.mintlify.site/on-premises/configuration/overleaf-toolkit/pandoc-import-and-export.md).

| | |
| - | - |
| Services | web (menus and routes), clsi (runs the conversion), in every Ayakaleaf Pro pod |
| Node | Docker Engine and `PANDOC_IMAGE`, on every node that can run Ayakaleaf Pro |
| Requires | [Sandboxed Compiles](https://ayakaleaf-pro.mintlify.site/on-premises/configuration/kubernetes/sandboxed-compiles.md) |
| Periodic jobs | none |

### Configuration

**1. Put the image into Docker on every node**

Build the image once from the `develop/pandoc` folder of the [ayakaleaf-pro](https://github.com/ayaka-notes/ayakaleaf-pro) repository, then load it into Docker on each node that can run Ayakaleaf Pro:

```bash theme={null}
docker build -t overleaf-pandoc:local develop/pandoc
docker save overleaf-pandoc:local | ssh node-1 sudo docker load    # repeat for every node
```

Or push it to a registry the nodes can reach and `sudo docker pull` it on each node. As with the TeX Live images, it must be in **Docker**, not only in containerd.

**2. ConfigMap**

```yaml theme={null}
  ENABLE_PANDOC_CONVERSIONS: "true"
  PANDOC_IMAGE: overleaf-pandoc:local
```

Both web and clsi read `ENABLE_PANDOC_CONVERSIONS` from the same ConfigMap, so they cannot disagree on Kubernetes.

**3. Apply and restart**

```bash theme={null}
kubectl apply -f 30-config.yaml
kubectl -n overleaf rollout restart deployment/overleaf     # or statefulset/overleaf
```

### Several replicas

Nothing extra beyond having the image on every node: each replica converts on its own node.

### Tested on Kubernetes

With the image built from `develop/pandoc` and loaded into Docker on every node with `docker save | docker load`, on Kubernetes 1.37 with one replica, our end-to-end tests for Pandoc pass (6 cases): importing a Markdown document as a LaTeX project, the error shown for a broken Word document, exporting Word (which imports again), Markdown and HTML, and the menus hidden without `ENABLE_PANDOC_CONVERSIONS`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.