Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-FMSCHEMA-005

Without a schema the table lists the keys in source order, escaped

When the frontmatter has no string `type`, or no schema lookup is made for the document, the extension SHALL show a two-column table headed Names and Values that lists the keys in source order, without type icons or a Description column, with every name, value, tooltip and data attribute escaped as text and its section marked as source line 1, and SHALL keep each key on one line in a key column as wide as its longest key, up to 40% of the table.

Another outcome at step 2 of path 1 in StRS-MDOKFSTUDIO-FMSCHEMA-001, in the state “The properties table is shown”.

Step 1 of path 2 in StRS-MDOKFSTUDIO-FMSCHEMA-006: from “The frontmatter has no string `type`” to “The generic Names and Values table is shown”.

Scenarios 5

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

nominalNo type
Givena document whose frontmatter is `b: 1` then `a: two`
Whenthe preview is rendered
Thena two-column table with the headers Names and Values lists b before a, with no type icon, no Description column and no badge
boundaryOther reasons for the generic table
InputOutcome
A document whose frontmatter is `type: 5` then `a: 1`The same generic two-column table lists type then a and no schema lookup message appears
A document whose frontmatter is `type: ''` then `a: 1`The generic table is shown and no schema lookup is made, so no info row appears
A schema exists for the type and the workspace is in Restricted ModeThe table is generic and no field is editable
A Markdown file opened outside every workspace folder with a typed frontmatterThe table is generic
refusalMarkup in a name or a value
InputOutcome
A field whose value is a bold tag, an ampersand and double quotes written as a YAML stringThe Value cell shows the characters literally (escaped as lt, amp and quot entities) and no bold element is created
A field whose name contains an angle bracketThe name appears as text in the Name cell and in the row attributes, never as an element
nominalThe properties section maps to source line 1
Givena document with frontmatter and a source mapping for the preview
Whenthe table is rendered
the editor cursor is on line 1 of the source and the preview syncs to the source line
Thenthe section carries the source line attribute 1
the preview scrolls back to the top where the properties section sits
boundaryThe key column fits its keys
InputOutcome
Keys such as name, description and metadata next to a long descriptionThe key column is as wide as the longest key; no key breaks inside a word and the Value column wraps in the rest
A long description and a nested metadata block of code next to short keys (a skill file), or keys shorter than the Names labelThe key column keeps the width of its longest key (never a few pixels), no key breaks inside a word, the Names label stays whole and the value cell wraps its text and keeps its code block inside the cell
A key wider than 40% of the tableThe key ends with an ellipsis, the key column stays within 40% of the table, and the full key is the tooltip of the key (shown for keys of more than 24 characters)

Implemented in 3

Tested by 6

Known limits (2)

Replaces

SwRS-MDOKFSTUDIO-FMSCHEMA-012Every table value is HTML-escaped superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-005 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-013The properties section maps to source line 1 superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-005 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-088The generic table is shown when no schema lookup is made superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-005 Markdown file