The DevXP engineering team hosts office hours every Thursday at 11 a.m.
Pacific Time where we answer your questions live and help you get up and
running with Flatfile. Join
us!
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.
Create a Document
You can create Documents using the API:Document Actions
Actions are optional and allow you to run custom operations in response to a user-triggered event from within a Document. Define Actions on a Document using theactions
parameter when a document is created:

Document treatments
Documents have an optionaltreatments
parameter which takes an array of treatments for your Document. Treatments can be used to categorize your Document. Certain treatments will cause your Document to look or behave differently.
Ephemeral documents
Giving your Document a treatment of"ephemeral"
will cause the Document to appear as a full-screen takeover, and it will not appear in the sidebar of your Space like other Documents. You can use ephemeral Documents to create a more focused experience for your end users.
Currently,
"ephemeral"
is the only treatment that will change the behavior
of your Document. Other treatments will not affect how your Document behaves,
but can be used for your own purposes to categorize and describe your
Documents in code.Adding Blocks to Documents
Blocks are dynamic, embedded entities that you can use to display data inside a Document. You can add a Block to a Document using the<embed>
HTML entity in your markdown and specifying which Block type you want to show using the type
attribute on the entity. Two Block types are currently supported: Embedded Sheet and Embedded Diff.
Embedded Sheet
Use this Block to render a Sheet along with all its data inside of a Document. You can embed a Sheet into your Document by passing a sheet ID, workbook ID, and name. You can also specify whether the embedded Sheet is expanded or collapsed when the document is loaded.You can include as many embedded Sheets in your Document as you like, but end
users will only be able to expand a maximum of 10 embedded Sheets at once.
Embedded Diff
Use this Block to show a side-by-side comparison of the data in a Sheet now versus at a previous point in time as captured by a Snapshot. Pass a Sheet ID, Workbook ID, and Snapshot ID. You can optionally pass adirection
attribute which specified whether the changes are displayed with the Snapshot as the end state (sheet_to_snapshot
) or the Sheet as the end state (snapshot_to_sheet
). The default value for direction is sheet_to_snapshot
.
Use
direction="sheet_to_snapshot"
if you want to show changes that have been
made since the time the Snapshot was taken, i.e. to review past changes. Use
direction="snapshot_to_sheet"
if to preview the changes that would occur if
you were to revert your Sheet back to the state it was in when the Snapshot
was taken.