Convert gridlayout to markdown table

to_md(layout, include_gap_size = TRUE)

Arguments

layout

Object of class "gridlayout".

include_gap_size

Should the gap size for the layout be added in upper-left of table?

Value

Markdown table that defines the grid layout. This can be used with the function grid_layout_from_md() to build grid layouts.

Examples


my_layout <- md_to_gridlayout("
  |      |        |       |       |
  |:-----|:-------|:------|:------|
  |10px  |120px   |1fr    |1fr    |
  |100px |header  |header |header |
  |1fr   |sidebar |plot_a |plot_c |
  |1fr   |sidebar |plot_b |plot_b |")
cat(to_md(my_layout))
#> | 10px  | 120px   | 1fr    | 1fr    |
#> |-------|---------|--------|--------|
#> | 100px | header  | header | header |
#> | 1fr   | sidebar | plot_a | plot_c |
#> | 1fr   | sidebar | plot_b | plot_b |