apluslms / a-plus-rst-tools

Tools to publish RST course content for mooc-grader and a-plus. Should be cloned as a course submodule.
MIT License
6 stars 24 forks source link

interactive code better user experience improvements #137

Closed yusein-ali closed 2 years ago

yusein-ali commented 2 years ago

Description

The interactive code editor had an issue with c/cpp language highlights and poor editing experience. CodeMirror indeed has better configuration options and many styles that can be configured and used. What?

  1. C/CPP kernel support is better checked
  2. CodeMirror can be configured in thebe-config dictionary. An example is thebe_config = { "binderUrl": "https://binder4.org.aalto.fi", "repository_url": "https://github.com/jupyter-xeus/xeus-cling/stable", "always_load": False, "codemirror-config": { 'theme': 'eclipse', 'indentUnit': "4", 'indentWithTabs': "true", 'electricChars': "true", 'lineNumbers': "true" } }
  3. thebe.py modified to support codemirror themes (only eclipse and abcdef theme styles for now), addons (matchbrackets is working, but show-hint is not -- so it can be removed), and codemirror-config parsing and handling.
  4. thebe.js modified just to get the c/cpp language name from the kernel name. That part should anyway be changed in the next releases.

Testing

What type of test did you run?

[ADD A DESCRIPTION ABOUT WHAT YOU TESTED MANUALLY]

Did you test the changes in

Think of what is affected by these changes and could become broken The changes are not expected to break anything since I have changed the dependencies.

Translation

Programming style

Yes

Have you updated the README or other relevant documentation?

It is not needed, but may be interactive code-related part in the README might be altered to show how thebe-config can be used to configure codemirror.

Is it Done?

Clean up your git commit history before submitting the pull request!

markkuriekkinen commented 2 years ago

Documentation links for myself:

markkuriekkinen commented 2 years ago

@yusein-ali I forgot to say this: the git commit is currently not linked to your GitHub account. The link is based on the commit author email and the email addresses in your GitHub profile. Would you like to fix the link so that you will better receive recognition for your A+ contributions? It is possible to rewrite history and change the author email in the existing git commit.