Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-PALETTE-271

Grid form inserts a MyST grid of cards

When the writer chooses Grid from the MyST palette or the slash menu, the extension SHALL open a form for the grid columns, gutter, number of cards and the header, footer and link of each card and, on Insert, write a {grid} directive holding that many {grid-item-card} directives after the selection.

Part of StRS-MDOKFSTUDIO-PALETTE-021, outside the paths drawn on its map.

Scenarios 2

The situations the tests check; open one to read it.

nominalOpen the form and insert
Givena block editor in the MyST palette mode
Whenthe writer presses the Grid button, or chooses Grid in the slash menu (the typed /query is removed first)
Thena form opens under the palette with the fields Columns, Gutter, Cards, Headers, Footers and Links; Insert writes a {grid} directive after the selection, with the columns as its argument, a :gutter: option when the gutter is filled, and one {grid-item-card} per requested card, and selects the title of the first card. Headers, Footers and Links hold one entry per card, separated by |: entry N of Links becomes the :link: option of card N, entry N of Headers its header line above a ^^^ separator and entry N of Footers its footer line under a +++ separator after the body (a grid card takes no :header: or :footer: option, unlike the Card form of SwRS-MDOKFSTUDIO-PALETTE-270), and an empty or missing entry leaves the option, line or separator out
boundaryRefusals and cancel
InputOutcome
Columns that are not one to four numbers from 1 to 12The form stays open and says why; nothing is written
A gutter that is not a number from 0 to 5 (empty is allowed)The form stays open and says why; nothing is written
A number of cards outside 1 to 24The form stays open and says why; nothing is written
Headers, Footers or Links with more entries than cardsThe form stays open and says why; nothing is written
Escape or CancelThe form closes and the text is unchanged

The vertical bar character inside a value is read as the separator between cards.

Implemented in 4

Tested by 3