io.display.markdown

Formatted text, written in markdown.

io.display.markdown shows formatted text in a page or in a step of an action. You write it in markdown: headings, paragraphs, lists, links and code. Use it for a warning before a delete or a short note on a page. It only displays and returns nothing.

The simplest one

The whole action file, and roughly what your team sees when it runs.

src/actions/accounts/deleteAccountAction.ts
import { app } from '../../app';
export const deleteAccountAction = app.defineAction({
name: 'Delete account',
handler: async ({ io }) => {
await io.display.markdown(`
## Before you delete
The account **Northwind** has 12 users.
- Their runs stay in the log
- Invoices are kept for 10 years
`);
},
});
The code. One call in an action, the whole file.
tools.example.com/actions/accounts/delete_account

Delete account

Before you deleteThe account Northwind has 12 users.
  • Their runs stay in the log
  • Invoices are kept for 10 years
Continue
In the browser. Roughly what your team sees. Your theme decides the details.

What you can set

The settings you will reach for most, each with the line of code that turns it on.

io.display.markdown('## Steps')

Headings, lists, links and code. Enough for the steps of a task, a checklist or a link to your policy.

io.display.markdown('**Paid**')

Just the text. The markdown is the first and only argument. There are no props to learn.

`The store **${store.name}**`

Values from your data. Write it as a template string and put values from the database right into the text.

`Hi ${customer.name}`

No markup from your data. Raw HTML in the text is shown as text. A value from the database cannot add its own markup.

warning: io.display.markdown(text),

Before a question. In io.group it sits next to inputs, such as a warning right above the box that confirms a delete.

return [io.display.markdown(note)];

On a page. Return it from a page handler to put a note or a rule on a folder's page.

Write your first tool today.

An async function, a few await calls, and the form is in the browser.

AwaitIO is free for small teams, made possible by companies and people who sponsor it.