# `Masu.Snapshot`
[🔗](https://github.com/hattoriai/masu/blob/v0.7.0/lib/masu/snapshot.ex#L1)

A grid's rows as they are now, as a table that reads without the grid:
Markdown, for a document exported with a grid in it (a Kotoba embed),
and HTML, for a page or an email that shows the document.

    sheet = Masu.Sheet.new(MyApp.Grids.tasks(scope))
    Masu.Snapshot.markdown(sheet, view: saved_view.params, rows: 20)

```markdown
| Task | Due | Done |
| :--- | :--- | :---: |
| Write the guide | 2026-11-02 | false |

_And 37 more rows._
```

Options:

  * `:view` - a view's params (`Masu.View`, a saved view's `params`):
    its order, filters, search, and columns that show. The grid's own
    view unless given.
  * `:rows` - how many rows, at most (20 unless given, 500 at most).
  * `:more` - what follows the rows when the query has more, a function
    of how many more (`"And 37 more rows."` unless given), or `nil` for
    nothing.

A cell is its value as text: a date in ISO 8601, a decimal to its last
digit. Cells of your own HEEx are their column's value.

# `table`

```elixir
@type table() :: %{
  columns: [Masu.Column.t()],
  rows: [[String.t()]],
  more: non_neg_integer() | nil
}
```

# `html`

```elixir
@spec html(Masu.Sheet.t(), keyword()) :: Phoenix.HTML.safe()
```

The snapshot as an HTML table (`table.masu-snapshot`), safe HTML.

# `markdown`

```elixir
@spec markdown(Masu.Sheet.t(), keyword()) :: String.t()
```

The snapshot as a Markdown table.

# `table`

```elixir
@spec table(Masu.Sheet.t(), keyword()) :: table()
```

The rows and columns of the snapshot, as text: `%{columns:, rows:,
more:}`, `more` the rows of the query past those, or `nil` when the
source does not count.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
