Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-MYST-072

MyST syntax of a disabled extension is reported with its line

When a document uses syntax of a MyST extension that the governing conf.py does not enable, the extension SHALL list one `myst-extension` warning per extension, at the first use of that syntax and with the line of the syntax itself, at most 10 per render, and leave the rendering unchanged.

Step 2 of path 1 in StRS-MDOKFSTUDIO-MYST-007: from “The enabled MyST extensions are known” to “The warnings are listed”.

Scenarios 6

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

nominalEach missing extension is detected once at its first use

The detected extensions are colon_fence, dollarmath, amsmath, deflist, fieldlist, tasklist, strikethrough, substitution, attrs_inline, html_image and html_admonition.

Given`:::` and `$x$` in a document whose conf.py enables neither
Whenthe document is checked
Thencolon_fence and dollarmath are detected once each, ordered by line, and the rendering is unchanged
boundaryThe same syntax twice gives one warning
Givena document using the same syntax twice
Whenthe document is checked
Thenone detection per extension, the first use
nominalThe warning carries the line of the syntax
Givena document with frontmatter and syntax on its ninth line
Whenthe document is checked
Thenthe warning line is 9, the frontmatter lines being counted
InputOutcome
Syntax inside a long paragraphthe line is the line of the syntax itself, not of the paragraph start
CRLF line breakslines are split like LF
CR line breakslines are split like LF
nominalThe status list shows the fixed wording
Givena missing dollarmath
another render diagnostic
Whenthe preview renders
the preview renders
Thenthe status area lists one warning as file:line: message, severity warning and code myst-extension, reading: `SYNTAX` is used but this needs the MyST extension `EXTENSION`, which is not enabled in your conf.py. Add "EXTENSION" to `myst_enable_extensions`. (SYNTAX is the used syntax, EXTENSION the missing extension), and the rendering is unchanged
it is coded myst-diagnostic
refusalNothing is reported for look-alikes, code, includes or a missing conf
InputOutcome
No conf.pyno warning is listed
`$x$` in a fenced block, an indented code block, inline code, a comment or a rolenothing is reported
`{math}` role, a backtick-fence directive, braces, `{% %}` or `$ 5`none counts as dollarmath, colon_fence or substitution
A `$$` block with a leading begin alignamsmath-guarded
Prices such as `$19 base ... ($200)`, `$5 and $6` or `$100-$380` with a conf.py without dollarmathno myst-extension warning is raised
A real `$x$` span (opening `$` not followed by a space, closing `$` not after a space or before a digit)dollarmath is reported as missing
An included file (`{include}`) using colon fences without colon_fence enabledno warning is raised for the included text
The same syntax in the document's own textthe warning is raised
boundaryAt most 10 warnings are kept
InputOutcome
11 missing extensions10 warnings are kept
10 or fewer missingall are kept

Implemented in 3

Tested by 4

Replaces

SwRS-MDOKFSTUDIO-CORE-064Warn about MyST syntax of a disabled extension superseded superseded by SwRS-MDOKFSTUDIO-MYST-072 Markdown file
SwRS-MDOKFSTUDIO-MYST-030Prices are not reported as missing dollarmath superseded superseded by SwRS-MDOKFSTUDIO-MYST-072 Markdown file
SwRS-MDOKFSTUDIO-MYST-073At most 10 extension warnings are kept superseded superseded by SwRS-MDOKFSTUDIO-MYST-072 Markdown file
SwRS-MDOKFSTUDIO-MYST-074Detection ignores code, comments, roles and look-alikes superseded superseded by SwRS-MDOKFSTUDIO-MYST-072 Markdown file
SwRS-MDOKFSTUDIO-MYST-075Warnings carry the line of the syntax superseded superseded by SwRS-MDOKFSTUDIO-MYST-072 Markdown file
SwRS-MDOKFSTUDIO-MYST-076Included files are not checked against conf.py superseded superseded by SwRS-MDOKFSTUDIO-MYST-072 Markdown file
SwRS-MDOKFSTUDIO-MYST-077Extension warnings use the fixed wording and status list superseded superseded by SwRS-MDOKFSTUDIO-MYST-072 Markdown file