Skip to content
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

Merged
merged 6 commits into from
May 26, 2021

Conversation

BarkingBad
Copy link
Contributor

@BarkingBad BarkingBad commented Apr 13, 2021

This PR adds:

  • User manual
  • Technical manual


#### Markdown

Markdown uses commonmark flavour to parse docstring, however it can understand `wikidoc` links.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. i wouldn't mention wikidoc here at all, line 120 above already did.
  2. could you include a link to a recent commonmark spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 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.
  2. Will fix

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?

Copy link
Contributor Author

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.

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.

Copy link
Contributor Author

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.

docs/docs/usage/scaladoc/scaladocDocstrings.md Outdated Show resolved Hide resolved
@BarkingBad BarkingBad force-pushed the scaladoc/update-docs branch from a060b64 to aacef13 Compare May 11, 2021 11:50
docs/docs/usage/scaladoc/settings.md Outdated Show resolved Hide resolved
docs/docs/usage/scaladoc/scaladocDocstrings.md Outdated Show resolved Hide resolved
docs/docs/usage/scaladoc/scaladocDocstrings.md Outdated Show resolved Hide resolved
docs/docs/usage/scaladoc/blog.md Outdated Show resolved Hide resolved
docs/docs/usage/scaladoc/scaladocDocstrings.md Outdated Show resolved Hide resolved
docs/docs/usage/scaladoc/scaladocDocstrings.md Outdated Show resolved Hide resolved
docs/docs/usage/scaladoc/scaladocDocstrings.md Outdated Show resolved Hide resolved
docs/docs/usage/scaladoc/scaladocDocstrings.md Outdated Show resolved Hide resolved
docs/docs/usage/scaladoc/staticSite.md Outdated Show resolved Hide resolved
docs/docs/usage/scaladoc/staticSite.md Outdated Show resolved Hide resolved
docs/docs/usage/scaladoc/staticSite.md Outdated Show resolved Hide resolved
scaladoc/documentation/docs/design.md Outdated Show resolved Hide resolved
scaladoc/documentation/docs/design.md Outdated Show resolved Hide resolved
docs/docs/usage/scaladoc/scaladocDocstrings.md Outdated Show resolved Hide resolved
docs/docs/usage/scaladoc/scaladocDocstrings.md Outdated Show resolved Hide resolved
docs/docs/usage/scaladoc/settings.md Outdated Show resolved Hide resolved
@BarkingBad
Copy link
Contributor Author

Hey @kitbellew @julienrf @KacperFKorban
thank you for your reviews, I hope I clarified all unclear parts. Please look at the conversations I didn't marked as resolved whether they still need work

@BarkingBad BarkingBad force-pushed the scaladoc/update-docs branch 2 times, most recently from cce4a62 to f704f25 Compare May 14, 2021 08:13
@BarkingBad BarkingBad force-pushed the scaladoc/update-docs branch from f704f25 to 6722416 Compare May 14, 2021 10:15

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.
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@BarkingBad BarkingBad requested a review from julienrf May 20, 2021 11:36
Copy link
Contributor

@julienrf julienrf left a 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.
Copy link
Contributor

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).
Copy link
Contributor

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.


##### -author

Include authors.
Copy link
Contributor

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?

@BarkingBad BarkingBad enabled auto-merge (squash) May 26, 2021 10:21
@BarkingBad BarkingBad merged commit 689625d into scala:master May 26, 2021
@BarkingBad BarkingBad deleted the scaladoc/update-docs branch May 26, 2021 12:29
@Kordyjan Kordyjan added this to the 3.0.1 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants