You didn't say what your tool chain or targeted output format is.
That being said, you can use Pandoc with mermaid-filter to export a Markdown file containing a Mermaid chart to a couple of formats.
Plus, with mermaid-filter you can select the theme using the fenced code block's key-value attributes options
E.g. let /tmp/example.md contain the following
```{.mermaid theme=forest}
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
```
then
pandoc --filter mermaid-filter --from markdown --to html /tmp/example.md > /tmp/example.html
will produce the an HTML page /tmp/example.html that looks as follows
