-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: broken highlighting in syntax summary for "
#14697
Comments
The highlight.js interpreted this snippet as bash. According to https://highlightjs.org/static/demo/ it supports BNF but unfortunately no EBNF. We can try BNF highlighting and if it'll be still broken, disable highlighting. |
Another thing is that this page is moved to: https://dotty.epfl.ch/docs/internals/syntax.html where the problem is solved. Shouldn't we remove the page from reference and add redirect to updated version? |
Good point @pikinier20. Yes, we need to figure out why there are two occurrences of this file, and which one should be kept. |
There are two |
I believe that keeping only one file to maintain would be simpler. Currently, if someone contributes a fix to Would it be possible to keep only one file? That file would include the experimental features. |
I think we need two files. One is docs for the official language reference, the other is docs for our internal implementation. Syntax changes should be rare and well thought through. Changing two syntax.md files is the least of our worries. We also have to change scalameta, ammonite, IntelliJ and all the other tools. That's the real burden. |
OK, then to fix the original issue we should just follow @pikinier20’s proposal: try marking the snippet as BNF code, and if it does not work mark it as plain text. |
From what I saw it's mostly about some small note/comment to some BNF rule. Some draft idea: The comments could be marked using some special reserved marker, e.g.
|
The Scaladoc processing logic can not really be special-cased for the Scala 3 documentation only, as it aims to be a general documentation generator. However, it might be possible to share common content by leveraging the template engine, I guess? |
Reopened since a commit was reverted by #14958 |
I see that this was done in the past in https://github.com/lampepfl/dotty/pull/14958/files, but then reverted in scala#14958. Like many commits, there really isn't an explanation of the revert, but from reading between the lines I assume the `;` was the actual issue, not the syntax highlighting. As it was pointed out, syntax.js doesn't actually support `ebnf`. They do say they support `bnf`, but that didn't really work when I was testing. Either way, this pr makes sure that we _do_ mark the snippets as `ebnf`. The reason for this isn't necessarily so that we _get_ syntax highlighting for these, but so that syntax.js doesn't infer the wrong type of syntax and provide odd highlighting like we currently have. This also helps to ensure screen readers know what type of codeblock this is. fixes scala#14697
I see that this was done in the past in https://github.com/lampepfl/dotty/pull/14958/files, but then reverted in #14958. Like many commits, there really isn't an explanation of the revert, but from reading between the lines I assume the `;` was the actual issue, not the syntax highlighting. As it was pointed out, syntax.js doesn't actually support `ebnf`. They do say they support `bnf`, but that didn't really work when I was testing. Either way, this pr makes sure that we _do_ mark the snippets as `ebnf`. The reason for this isn't necessarily so that we _get_ syntax highlighting for these, but so that syntax.js doesn't infer the wrong type of syntax and provide odd highlighting like we currently have. This also helps to ensure screen readers know what type of codeblock this is. fixes #14697
https://dotty.epfl.ch/docs/reference/syntax.html
The text was updated successfully, but these errors were encountered: