mystmd
mystmd copied to clipboard
specify line number when language of code directive is undefined
If a code directive is missing the language argument it would be nice to include the line number of the file in which this came from. Ideally the link to the file would also jump to the specific line.
This seems like a simple enhancement, but perhaps it may be relevant for other directives besides the code directive.
Proposal
Currently I get this response in CLI (which does list the file name):
⚠️ content/lessons/Lesson1.md Language is not defined for code block
My first thought was "I wish this told me which line number in the file, and the hyperlink jumped to that line as well."
It may be obvious that I only need to search for {code} to find the offending line, but this was not trivial for me as I am learning to use myst, and because the files were from someone else (thus I never wrote the code directive).
In addition, it might be nice to add the following note in the CLI output when the standard markdown syntax is used (i.e., the three tick marks):
`
, Line : you are using standard Markdown syntax for a code block, but the MyST code directive provides additional options: {code}.
Finally, a third aspect (regardless of changes to CLI output) would be to update the documentation to clarify which languages are supported for syntax highlighting and what the argument is for each in the code directive (a link to the docs page for whatever syntax tool is used would suffice). MyST doc pages to update are the code and code-block page and the code directive page.
Additional notes
I did this with myst build --pdf. I tried the standard markdown syntax without a language specified and did not get a warning.