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

Recover syntax highlighting for sample problems. #2639

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

drgrice1
Copy link
Member

This was an oversight when I made the switch to the PG CodeMirror editor with CodeMirror 6. The sample problems also use CodeMirror for syntax highlighting. Since the CodeMirror 5 javascript is no longer available that fails.

The pg-codemirror-editor package now exports a runMode method (available via the global PGCodeMirrorEditor object), that essentially does what the CodeMirror 5 runMode addon method did. It is slightly different in that it only works for the PG language. At this point we don't use it for anything else, so that should be good for now.

@drgrice1 drgrice1 force-pushed the pg-codemirror-static branch 2 times, most recently from fe91836 to 10fc144 Compare December 10, 2024 20:31
@drgrice1 drgrice1 force-pushed the pg-codemirror-static branch 2 times, most recently from c50576a to 2b9446a Compare December 11, 2024 23:59
@drgrice1
Copy link
Member Author

Note that the version of the pg-codemirror-editor that this updates to also includes some fixes for syntax highlighting in interpolation (the fixes are really in the codemirror-lang-pg, codemirror-lang-perl, and codemirror-lang-mt packages).

(I accidentally put this comment in openwebwork/pg#1149, but it was meant for this pull request.)

This was an oversight when I made the switch to the PG CodeMirror editor
with CodeMirror 6.  The sample problems also use CodeMirror for syntax
highlighting.  Since the CodeMirror 5 javascript is no longer available
that fails.

The pg-codemirror-editor package now exports a `runMode` method
(available via the global `PGCodeMirrorEditor` object), that essentially
does what the CodeMirror 5 `runMode` addon method did.  It is slightly
different in that it only works for the PG language. At this point we
don't use it for anything else, so that should be good for now.
@drgrice1 drgrice1 force-pushed the pg-codemirror-static branch from 2b9446a to 3c73acc Compare December 17, 2024 03:42
Copy link
Contributor

@somiaj somiaj 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. I did find the contrast with the default theme and the background used for the code cells a little low, and some of the redish colors blended together to much for me.

Copy link
Member

@pstaabp pstaabp left a comment

Choose a reason for hiding this comment

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

👍

@Alex-Jordan Alex-Jordan merged commit 7e386f9 into openwebwork:develop Dec 17, 2024
2 checks passed
@drgrice1 drgrice1 deleted the pg-codemirror-static branch December 17, 2024 23:44
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.

4 participants