Guides
Build Documents

Documents are standalone webpages for your Flatfile Spaces. They can be rendered from Markdown syntax.

Often used for getting started guides, Documents become extremely powerful with dynamically generated content that stays updated as events occur.

Flatfile also allows you to use HTML tags in your Markdown-formatted text. This is helpful if you prefer certain HTML tags rather than Markdown syntax.

Building a Document

Learn how to create a Document and update a Document from an Event listener.

const createDoc = await api.documents.create(spaceId, {
  title: "Getting Started",
  body:
    "# Welcome\n" +
    "### Say hello to your first customer Space in the new Flatfile!\n" +
    "Let's begin by first getting acquainted with what you're seeing in your Space initially.\n" +
    "---\n",
});

Markdown reference

Headings

# Heading level 1
## Heading level 2
### Heading level 3
#### Heading level 4
##### Heading level 5
###### Heading level 6

The rendered output looks like:

Heading level 1

Heading level 2

Heading level 3

Heading level 4

Heading level 5
Heading level 6

My favorite search engine is [Duck Duck Go](https://duckduckgo.com).

The rendered output looks like:

My favorite search engine is Duck Duck Go.


Text formatting

**Love** is bold.
Italicized text is the *cat's meow*.
This text is ***bolded and italicized***.
Superscript <sup>superscript</sup>
Subscript <sub>subscript</sub>
> Dorothy followed her through many of the beautiful rooms in her castle.
Use `code` in your Document.

The rendered output looks like:

Love is bold.

Italicized text is the cat’s meow.

This text is bolded and italicized.

Superscript superscript

Subscript subscript

Dorothy followed her through many of the beautiful rooms in her castle.

Use code in your Document.


Lists

<!-- ordered lists -->
1. First item
2. Second item
3. Third item
4. Fourth item
<!-- unordered lists -->
- First item
- Second item
- Third item
- Fourth item
<!-- nested lists -->
- First parent item
- Second parent item
  - Additional item
  - Additional item
- Third parent item

The rendered output looks like:

Ordered Lists

  1. First item
  2. Second item
  3. Third item
  4. Fourth item

Unordered Lists

  • First item
  • Second item
  • Third item
  • Fourth item

Nested Lists

  • First parent item
  • Second parent item
    • Additional item
    • Additional item
  • Third parent item

Images

San Juan Mountains are beautiful!](https://i0.wp.com/sjma.org/wp-content/uploads/2018/04/Ice-Lakes-BG.jpg "San Juan Mountains")

Tables

| Property | Description                           |
| -------- | ------------------------------------- |
| Name     | Full name of user                     |
| Age      | Reported age                          |
| Joined   | Whether the user joined the community |

The rendered output would look like:

PropertyDescription
NameFull name of user
AgeReported age
JoinedWhether the user joined the community