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

Scaladoc: Integrate Scastie into Scaladoc #13258

Merged
merged 6 commits into from
Aug 26, 2021

Conversation

pikinier20
Copy link
Contributor

@pikinier20 pikinier20 commented Aug 5, 2021

also fixes #13275

Release notes template

Integrated Scastie into Scaladoc to make snippets interactive.

@pikinier20 pikinier20 force-pushed the scaladoc/scastie-integration branch 2 times, most recently from 004edfa to 582b389 Compare August 11, 2021 08:35
@pikinier20 pikinier20 marked this pull request as ready for review August 12, 2021 09:34
@pikinier20 pikinier20 added the release-notes Should be mentioned in the release notes label Aug 17, 2021
@pikinier20
Copy link
Contributor Author

closes #13065

Copy link
Member

@KacperFKorban KacperFKorban left a comment

Choose a reason for hiding this comment

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

Looks good to me. Two nitpicks/questions:

  1. Should the resources (like font-awesome) be downloaded (like inkuire.js) or added to the repo as static files?
  2. Does scastie API allow to change the initial cursor position? IMHO it would be better for it to be at the end.

scaladoc/src/dotty/tools/scaladoc/site/templates.scala Outdated Show resolved Hide resolved
@pikinier20 pikinier20 merged commit 7a6cabe into scala:master Aug 26, 2021
@pikinier20 pikinier20 linked an issue Aug 27, 2021 that may be closed by this pull request
@deusaquilus
Copy link
Contributor

Hey @pikinier20. I'm really curious about how this scastieConfiguration.js works. I'd love to put protoquill examples into Scala3doc but nearly all of them will need a bunch of pre-created code to work. Can scastieConfiguration.js specify sbt dependencies for Scastie to load?

@pikinier20
Copy link
Contributor Author

pikinier20 commented Jan 11, 2022

Hey @pikinier20. I'm really curious about how this scastieConfiguration.js works. I'd love to put protoquill examples into Scala3doc but nearly all of them will need a bunch of pre-created code to work. Can scastieConfiguration.js specify sbt dependencies for Scastie to load?

Hey, yes, there's a setting in Scaladoc:

val scastieConfiguration: Setting[String] =
    StringSetting("-scastie-configuration", "Scastie configuration", "Additional configuration passed to Scastie in code snippets", "")

You can there specify libraryDependencies setting. It will probably be done better in future (automatically get this configuration from sbt) but for now it works like that.

From what I remember, it may be tricky to properly escape quotes.

@Kordyjan Kordyjan added this to the 3.1.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes Should be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show collapsed lines always visible Scaladoc: Implement "Run" logic in snippets
4 participants