Skip to content

use dotty website code highlighting #2798

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 2 commits into from
May 11, 2023

Conversation

bishabosha
Copy link
Member

I made a few changes to what was on the dotty website, but in general improvements are:

  • quotes and splices
  • various numeric literals (hex, floating + exponent, _ digit separators)
  • enums
  • triple quote string literals (specifically that mix other quotes inside)
  • escaped characters

critically json in string literals renders correctly for the toolkit tutorials:
Screenshot 2023-05-11 at 10 32 32

maybe at some point we can try to update the official highlight-js for scala with these changes

Copy link
Contributor

Choose a reason for hiding this comment

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

The end result looks great, but is it possible to publish that package on npm and reference it from there rather than copying it here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Who is it maintained by? Are there any tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean our own custom package? or the official hljs CDN?

But maybe its better to incubate here (temporarily) so we can improve any issues?

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

This fixes a lot of issues, but please make sure the syntax highlighting implementation is eventually contributed upstream to highlight.js (see https://github.com/highlightjs/highlight.js/blob/main/src/languages/scala.js) so that we don’t maintain multiple copies of it.

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.

2 participants