# Fields - Mermaid Support

You can include charts, diagrams, and other visual elements using the Mermaid syntax within designated fields of your document template. Supported diagram types include flowcharts, sequence diagrams, class diagrams, Gantt charts, and entity-relationship models and more.

**Check Mermaid Tutorials & Syntax** -<https://mermaid.js.org/ecosystem/tutorials.html>

This feature enables users to embed complex, structured visual content using simple, text-based definitions directly within their document generation workflow.

#### HTML/Markdown Template Fields

Both Markdown and HTML fields support mermaid elements passed as content

```
{*htmlField}
{!markdownField}
```

#### Usage in HTML fields

Include mermaid syntax in **paragraph with class "mermaid"**

```
<h1>This is header for diagram below</h1>
<pre class="mermaid">
  graph TD;
      A-->B;
      A-->C;
      B-->D;
      C-->D;
</pre>
```

#### Usage in Markdown fields

Include mermaid syntax in **starting with\`\`\`mermaid and end syntax with \`\`\`**

````
# This is header for diagram below

```mermaid
  graph TD;
      A-->B;
      A-->C;
      B-->D;
      C-->D;
```
````

#### Sample Output

<figure><img src="https://1713720388-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRMYKAUZ0NsaDRvNONC3%2Fuploads%2FzTcVEubx8IyfLD5oaV9D%2Fimage.png?alt=media&#x26;token=cfa46451-f0dc-469b-88df-d5b6bf0c4258" alt="" width="178"><figcaption></figcaption></figure>


---

# 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.documentero.com/documentation/templates/fields-mermaid-support.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.
