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

feat: better syntax highlighting for descriptions and instructions #627

Merged

Conversation

Sembauke
Copy link
Member

@Sembauke Sembauke commented Oct 13, 2022

This adds better highlighting in the learn component. The readability is now better for both instructions and description.

It uses the highlightingView plugin that is already used for some of the aspects in news / learn.

Now instead of only highlighting the syntax that is normally highlighted by Prisma. It now highlights everything. Instead of having a boring container, with a bad font.

We should also consider different themes for the highlighter. This one is now set to atom-one-dark
Before:

image

After:

image

@Sembauke Sembauke requested a review from a team as a code owner October 13, 2022 12:50
@Sembauke Sembauke added the status: waiting review Waiting for review label Oct 17, 2022
Nirajn2311
Nirajn2311 previously approved these changes Oct 22, 2022
Copy link
Member

@Nirajn2311 Nirajn2311 left a comment

Choose a reason for hiding this comment

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

Everything LGTM but the text is not selectable yet and the PR for it in the respective package hasn't been merged after staying open for over a year

@Sembauke
Copy link
Member Author

Hey @Nirajn2311,

Thanks for pointing that out. What do you think we should do?

@Sembauke
Copy link
Member Author

Sembauke commented Oct 24, 2022

I went ahead and did the following:

  1. forked the syntax highlighting plugin (should be fine because it has not been updated in years)
  2. checked out the pull request, made by one of the users of the package.
  3. pushed the change to my fork

To test this out you need to do the following:
You need to link phoneIDE to your local path otherwise it will cause conflicts with the new version of the highlighter.
After this add this in phoneIDE:

  flutter_highlight:
    git:
      url: https://github.com/sembauke/highlight.dart
      ref: master
      path: ./flutter_highlight 

after this you can get and run.

let me know what you think of it.

cc: @Nirajn2311

@Sembauke
Copy link
Member Author

freeCodeCamp/PhoneIDE#23

@Nirajn2311 Nirajn2311 merged commit 6b99290 into freeCodeCamp:main Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants