> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/ios/generate/generate-via-template/structured-input.md).

# Document Generation Structured Input

Learn about the powerful features of a template engine for structured input in HTML and markdown, including styled text, lists, hyperlinks, and headings. Contact us for feature suggestions! The Apryse

## Overview

The template engine can fill template tags with structured input, which is more powerful than simple text. It supports:

* styled text
* paragraphs
* lists
* tables
* hyperlinks
* headers
* more (see below)

Structured input can be provided as either HTML or markdown, by supplying a JSON object with the property "html" or "markdown". Example:

{% tabs %}
{% tab title="JSON" %}
{% code lineNumbers="true" %}

```json
{
    "template_tag_1": {
        "markdown": "# Markdown demo\nHello *world*\n\n---\n"
    },
    "template_tag_2": {
        "html": "<u>Underlined text <span style='color: red'>red text</span></u>"
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

In markdown and HTML whitespace is treated differently than normal template text filling. In HTML, whitespace after an opening tag and before a closing tag is ignored, and all other whitespace is converted to a singe space.

Markdown input can also use inline HTML.

We are interested in expanding the breadth of features for HTML, markdown, and CSS, so please [contact us](https://docs.apryse.com) if you have any features suggestions!

## Styled text

Spans of text can be styled individually. With both markdown and HTML input, you can style text to be:

* Bold
* Italic
* Strikethrough

HTML input additionally supports underlined text, as well as the following properties using inline css:

* font-size (specified in absolute units)
* font-family
* color (specified by hex color (prefixed with #), named color (eg. red), rgb(r, g, b), or rgba(r, g, b, a))
* background-color

Example:

{% tabs %}
{% tab title="HTML" %}
{% code lineNumbers="true" %}

```html
<span style='font-size: 12pt; font-family: "monospace"; color: #ff00ff; background-color: yellow'>Funky text</span>
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Lists

Unordered and ordered lists are supported in both HTML and markdown. A list item will break a paragraph, see [paragraphs](https://docs.apryse.com). By default, the bullets and numbering styles are similar to Microsoft Word. With HTML input, this can be changed using the CSS property list-style. Ordered lists support decimal, alpha, and roman numbering. Unordered lists support any bullet character. Example:

{% tabs %}
{% tab title="HTML" %}
{% code lineNumbers="true" %}

```html
<ul style='list-type: ">";'>
    <li>Bulleted item</li>
    <ol style='list-type: lower-roman; font-weight: bold'>
        <li style='font-weight: normal'>Numbered item</li>
    </ol>
</ul>
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Tables

Tables are supported in HTML, and can be styled with inline CSS. Properties supported include borders, background color, and cell width. Merged cells are also supported with the `colspan` and `rowspan` attributes. If you need additional functionality, please contact our support team.

{% tabs %}
{% tab title="HTML" %}
{% code lineNumbers="true" %}

```html
<table style='width: 6in; border: 1px solid black'>
    <tr>
        <th style='width: 25%; background-color: #333'>First column</th>
        <th style='width: 75%'>Second column</th>
    </tr>
    <tr>
        <td colspan='2' style='border-top: 1px double gray'>Cell</td>
    </tr>
</table>
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Hyperlinks

Hyperlinks are supported in both HTML and markdown. Hyperlinks are automatically styled to be blue and underlined. If this is undesirable, you can override it using inline CSS. Example:

{% tabs %}
{% tab title="HTML" %}
{% code lineNumbers="true" %}

```html
<a style='text-decoration: none; color: black' href='https://apryse.com'>Click me</a>
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Headings

Headings 1-6 are supported in both HTML and markdown. The heading style is extracted from the template document itself. If you wish to change the heading styles, modify the styles "Heading 1", "Heading 2", etc. of the template document in your word processor. Alternatively, modify the style using inline CSS.

## Paragraphs

The inserted text can be made up of multiple paragraphs. This is supported in both HTML (using `<p>`) and markdown (using two newlines). If the template tag appears in the middle of a paragraph and the input contains multiple paragraphs, the tag's paragraph will be split to accommodate the inserted paragraph breaks, as if a user was typing the inserted text in and inserts a paragraph break.

## Other

Line breaks are supported in HTML (`<br>`). Horizontal lines are supported in HTML (`<hr>`) and markdown (`---` on a separate line).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/ios/generate/generate-via-template/structured-input.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
