Use case StRS-MDOKFSTUDIO-CODE-001
A reader reads highlighted, numbered and diff code
Writers need code samples to read as they would in published documentation, in the language and colours of their editor, and reviewers need to see at a glance what a change adds and removes.
Use case diagram
How it is split
This use case (StRS) is reached by 2 paths, one per coloured line. A path goes from one situation (circle) to the next; each step (pill) is a behaviour (SwRS) with its own tests.
path 1: Read highlighted code path 2: Review a diff other outcomeone dot = one scenario checked: nominal boundary refusal
Path 1: Read highlighted code
- A document holds a fenced code blockSwRS-MDOKFSTUDIO-CODE-001 an unknown or absent language stays plain textSwRS-MDOKFSTUDIO-CODE-001 · 6 tests the preview colours the keywords, strings, numbers and comments of the language named by the fence label
- The code is colouredSwRS-MDOKFSTUDIO-CODE-039 a single line is never numberedSwRS-MDOKFSTUDIO-CODE-039 · 10 tests with the line numbers setting on, a block of two lines or more is numbered
- The lines of the code are numbered
Path 2: Review a diff
- A document holds a diff blockSwRS-MDOKFSTUDIO-CODE-008 the first character decides the markSwRS-MDOKFSTUDIO-CODE-008 · 3 tests lines starting with + are marked as additions and lines starting with - as deletions
- Additions and deletions are marked in a full-width panel
This map has 74 different ways through it in 8 steps or fewer. Instead of testing each one end to end, the 3 behaviours on the map are tested one by one, with 21 scenarios.
Behaviours of this use case
SwRS-MDOKFSTUDIO-CODE-001Fenced code in a supported language is highlighted, other code stays literal 6 testsSwRS-MDOKFSTUDIO-CODE-007Code blocks use one font scale, one box and scroll long lines not on the map3 testsSwRS-MDOKFSTUDIO-CODE-008Diff blocks show additions and deletions 3 testsSwRS-MDOKFSTUDIO-CODE-014A code directive shows its file name or caption above the code not on the map2 testsSwRS-MDOKFSTUDIO-CODE-039Code lines are numbered and emphasized 10 testsSwRS-MDOKFSTUDIO-CODE-040Code blocks sit on a dark Dark+ background in every preview theme by a setting not on the map5 testsSwRS-MDOKFSTUDIO-CORE-028Body text, headings, lists and block quotes are typeset readably not on the map5 testsSwRS-MDOKFSTUDIO-CORE-089Inline code is a readable tinted pill in text, links, tables and forced themes not on the map1 test
SwRS-MDOKFSTUDIO-CODE-002Resolve common fence labels to a supported grammar superseded superseded by SwRS-MDOKFSTUDIO-CODE-001 Markdown file
SwRS-MDOKFSTUDIO-CODE-003Read the fence label case-insensitively up to its first separator superseded superseded by SwRS-MDOKFSTUDIO-CODE-001 Markdown file
SwRS-MDOKFSTUDIO-CODE-004Leave unknown-language code as plain text superseded superseded by SwRS-MDOKFSTUDIO-CODE-001 Markdown file
SwRS-MDOKFSTUDIO-CODE-005Numbered, emphasized and diff blocks are wrapped into lines superseded superseded by SwRS-MDOKFSTUDIO-CODE-001, SwRS-MDOKFSTUDIO-CODE-039 Markdown file
SwRS-MDOKFSTUDIO-CODE-006Show special characters once in highlighted code superseded superseded by SwRS-MDOKFSTUDIO-CODE-005 Markdown file
SwRS-MDOKFSTUDIO-CODE-009Colour diff file header lines like ordinary lines superseded superseded by SwRS-MDOKFSTUDIO-CODE-008 Markdown file
SwRS-MDOKFSTUDIO-CODE-010Use system colours for diff lines in forced-colours mode superseded superseded by SwRS-MDOKFSTUDIO-CODE-008 Markdown file
SwRS-MDOKFSTUDIO-CODE-011Number and emphasize lines of MyST code directives superseded superseded by SwRS-MDOKFSTUDIO-CODE-005 Markdown file
SwRS-MDOKFSTUDIO-CODE-012Style fenced code blocks with one font scale and the code background superseded superseded by SwRS-MDOKFSTUDIO-CODE-007 Markdown file
SwRS-MDOKFSTUDIO-CODE-013Scroll long code lines inside their block superseded superseded by SwRS-MDOKFSTUDIO-CODE-007 Markdown file
SwRS-MDOKFSTUDIO-CODE-015Render a captioned code directive as a figure with a reference target superseded superseded by SwRS-MDOKFSTUDIO-CODE-014 Markdown file
SwRS-MDOKFSTUDIO-CODE-016Keep code backgrounds soft and readable in the forced white and cream themes superseded superseded by SwRS-MDOKFSTUDIO-CODE-007 Markdown file
SwRS-MDOKFSTUDIO-CODE-028Join a code caption to its block as a title bar superseded superseded by SwRS-MDOKFSTUDIO-CODE-014 Markdown file
SwRS-MDOKFSTUDIO-CODE-030Never highlight inline code superseded superseded by SwRS-MDOKFSTUDIO-CODE-001 Markdown file
SwRS-MDOKFSTUDIO-CODE-031Show fenced code text literally superseded superseded by SwRS-MDOKFSTUDIO-CODE-001 Markdown file
SwRS-MDOKFSTUDIO-CODE-036Show diff blocks as a full-width square panel superseded superseded by SwRS-MDOKFSTUDIO-CODE-008 Markdown file
SwRS-MDOKFSTUDIO-CODE-037Fall back to escaped text lines when a grammar fails superseded superseded by SwRS-MDOKFSTUDIO-CODE-001 Markdown file
SwRS-MDOKFSTUDIO-CODE-038Colour YAML code text with the link colour in the forced white and cream themes superseded superseded by SwRS-MDOKFSTUDIO-CORE-028 Markdown file