Skip to content

Refactor: Add documentation for the Scastie configuration #2810

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

Merged
merged 1 commit into from
May 24, 2023

Conversation

Dedelweiss
Copy link
Contributor

@Dedelweiss Dedelweiss commented May 23, 2023

I have noticed that in most Scala projects using Scaladoc with snippets. When snippets were using external libraries, these did not work. Example:
Screenshot 2023-05-23 at 16 02 45

Planned or just lack of interest to look into it further, the question remains "How to fix it?".
So I noticed that a -scastie-configuration flag was present but as discussed in Issue #16220 on Dotty, nothing explains how to use it or anything.
So when testing some things, I noticed that it was behaving like the "Add Extra Sbt Configuration" input of the Scastie web application.

Screenshot 2023-05-23 at 16 06 32

And as soon as I added the following piece of code, the snippet worked as it should.

Screenshot 2023-05-23 at 16 10 04 Screenshot 2023-05-23 at 16 13 26

So the goal to this PR is to add some documentation about -scastie-configuration flag so the users can make the best use of Scastie.

Fixes: scala/scala3#16220

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.

Thank you for the investigation and the fix! Indeed, documenting this option seems important. There is something that is still unclear to me: how do we enable the “Scastie button”?

@Dedelweiss
Copy link
Contributor Author

Thank you for the investigation and the fix! Indeed, documenting this option seems important. There is something that is still unclear to me: how do we enable the “Scastie button”?

Hello, If I'm not mistaken and you are talking about the "play" button. It seems to me that it is activated when you put the sc:compile part. I can add it in the documentation but does it fit in the flags part or would a dedicated page be better?
Screenshot 2023-05-24 at 08 39 27
Screenshot 2023-05-24 at 08 39 35
Screenshot 2023-05-24 at 08 46 34

@Dedelweiss Dedelweiss requested a review from julienrf May 24, 2023 06:54
@julienrf
Copy link
Contributor

Thank you for the improvement. I think at some point we should also document better the whole feature that adds this “play” button, but that could be done in a separate PR.

@julienrf julienrf merged commit e59c7e3 into scala:main May 24, 2023
@Dedelweiss
Copy link
Contributor Author

Dedelweiss commented May 24, 2023

Thank you for the improvement. I think at some point we should also document better the whole feature that adds this “play” button, but that could be done in a separate PR.

Thank you, okay sure, I can do it if it's not a problem. I was thinking of either a page or a part here dedicated to the explanation of the possible parameters after the ```of a blockquote. Or else a page dedicated to the explanation of Scastie and its possible uses, I haven't found much of a page talking about it on docs.scala-lang (except briefly if I'm not mistaken).

@julienrf
Copy link
Contributor

That would be great if you can do it! 🙏

Is that feature related to the -snippet-compiler:compile option described here? If yes, I think the documentation could go to that page (maybe rename it to “Embedding code snippets” to make it more general, and make subsections like “snippets checking” and “interactive snippets”).

@Dedelweiss
Copy link
Contributor Author

Dedelweiss commented May 24, 2023

Ho sorry, I will see if I have any improvements to suggest but I notice the documentation is already there. Indeed, if I'm not mistaken, the "Getting Started" part explains how to activate all the snippets and then the "Advanced configuration" part explains how to individually activate a snippet as I did with sc:compile. I can even add an example for sc:compile and sc:nocompile because it is only the case for sc:fail in features overview.

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.

No documentation for -scastie-configuration
2 participants