-
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
Update user manual for scaladoc #12083
Conversation
83e07f6
to
0288354
Compare
|
||
#### Markdown | ||
|
||
Markdown uses commonmark flavour to parse docstring, however it can understand `wikidoc` links. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- i wouldn't mention wikidoc here at all, line 120 above already did.
- could you include a link to a recent commonmark spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The clue here is that you can write markdown code with wikidoc links, e. g.
This is my *markdown* with wikidoc link to [[ my.Class ]]
. If this sentence is confusing, I can elaborate. - Will fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment seems to suggest that one must choose either markdown or the old way, not both, and the only exception is those links.
if that's not true, why do you need to call out the links specifically, if one can mix and match anything with anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether you talk about outdated or new version of this sentence.
As it comes to language for docstring styling, you have to choose either Wikidoc
or Markdown
(at least single docstring must be fully markdown or fully wikidoc), however we added extension to markdown syntax so you can use Wikidoc
links while using Markdown
regular elements like bold with asterisks. It is quite useful, because these links are more intelligent than regular markdown links and let you link classes etc. by their fully qualified name, so you don't have to know the absolute path of these elements.
I thought one would not be aware of this extension so this is what I meant saying Markdown uses commonmark flavour with extension of wikidoc links for referencing convenience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's an important observation, @BarkingBad ! i was not aware that one must choose a style for a single docstring and assumed that one can use markdown and something else mixed. can't i specify:
/**
* ```scala
* some code
* ```
* also
* {{{
* some other code
* }}}
*/
also, what's wikidoc? a search on google doesn't bring up any relevant results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wikidoc syntax is legacy syntax used by old scaladoc. I think it's spec can be found here. The 3 curly braces was a way to declare code blocks in Scala2
(I'm not sure is it official spec or just addition by Scala2 scaladoc creators). In new Scaladoc we assume 3 curly braces syntax as part of Wikidoc
and 3 backticks as Markdown
.
But...
I must have missed Alekasnder's PR that implements curly braces as code blocks valid syntax even if Markdown is used. I guess I need to update the docs then.
a060b64
to
aacef13
Compare
aacef13
to
36b25cf
Compare
Hey @kitbellew @julienrf @KacperFKorban |
cce4a62
to
f704f25
Compare
f704f25
to
6722416
Compare
|
||
In the example above, this Scaladoc comment is associated with the method square since it is right before it in the source code. | ||
|
||
Scaladoc comments can go before fields, methods, classes, traits, objects and even (especially) package objects. Scaladoc comments for package objects make a great place to put an overview of a specific package or API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no package objects anymore in Scala 3? How do we document a package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an issue to deal with this problem, however many intuitive solutions require changes in sbt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, should we change/remove the part about package objects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is some copy-paste leftover, I'll change it and point it to the github issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have a few comments, but this is good to go.
|
||
In the example above, this Scaladoc comment is associated with the method square since it is right before it in the source code. | ||
|
||
Scaladoc comments can go before fields, methods, classes, traits, objects and even (especially) package objects. Scaladoc comments for package objects make a great place to put an overview of a specific package or API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, should we change/remove the part about package objects?
## Parity with scaladoc for Scala 2 | ||
|
||
Scaladoc has been rewritten from scratch and some of the features turned out to be useless in the new context. | ||
If you want to know what is current state of compatibility with scaladoc old flags, you can visit this issue for tracking [progress](https://github.com/lampepfl/dotty/issues/11907). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m adding a note here to not forget to update this link after scala/docs.scala-lang#2012 is merged.
docs/docs/usage/scaladoc/settings.md
Outdated
|
||
##### -author | ||
|
||
Include authors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove line 102?
This PR adds: