-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix markdown syntax for scala3 library docstrings #11612
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
Fix markdown syntax for scala3 library docstrings #11612
Conversation
There might be more docstrings that need |
I don't understand this change, doesn't scaladoc use markdown syntax by default? We certainly want to use it by default for all new code, having to add |
Well, scaladoc uses markdown syntax by default. However, most of the compiler has comments with wikisyntax. Therefore, we run scaladoc with wikisyntax flag raised. We could either:
The third option was the easiest as I didn't have to rewrite all the conflicting symbols. |
Do you have examples? From what I can see, most of the comments use markdown syntax (backticks for code are very commonly used for example). Also, can't we support using both syntaxes at once? |
Just browsed the |
As for supporting both syntaxes, it is hard as we should have to assume whether something is in markdown or wikisyntax, which I think we cannot so easily determine. |
[[ is supported under markdown syntax according to http://dotty.epfl.ch/docs/usage/scaladoc/docComments.html Limiting myself to % rg -o '\*.*\{\{\{' library compiler interfaces scaladoc tasty-inspector staging language-server|wc -l
68 Am I missing something? Perhaps you're also looking at the scala 2 standard library scala files, but that's a different project (and this one does use wiki syntax since it has to work with the scala 2 scaladoc too). |
Yes, you are right. However I thought we want to have wikisyntax as a default for compiler. So what do you propose? Certainly we have to revert these changes, but should we update the old comments with |
I think ideally we should support wiki code blocks by default if possible: #11728 (comment), otherwise I would prefer to default to markdown syntax and rewrite comments (maybe we can do that with a regexp to replace {{{ and }}} by three backticks). |
I talked with @romanowski and he told me we document a lot of scala2 code in our projects which has wikisyntax docstrings. Maybe the best solution is to remove flag |
Before

After
