Forum Discussion

RockyLittle-297's avatar
RockyLittle-297
Community Member
6 years ago

Color Syntax Highlighter for Code Snippet

Hi all, I love the Code Snippet Feature as it allows learners to copy and paste the code. One thing that would be super helpful is if there was a way to show the colors syntax highlighter for readability. Is there a way we can tap into that/add as a feature. It's critical for learners who are geared towards software engineering.  

20 Replies

    • SashaVodnik-857's avatar
      SashaVodnik-857
      Community Member

      Interesting.

      If I understand correctly, it looks like the process would be:

      1. Create a course in Rise.
      2. Export the SCORM.
      3. Open the SCORM in your file manager and add the files for this extension.
      4. Make any edits to the HTML, CSS, and JS files in a code editor.
      5. Import the updated SCORM back into Rise.

      Not sure that's scalable for my team's workflow, but interesting to know it's technically possible.

      • KaylaHsu-389d13's avatar
        KaylaHsu-389d13
        Community Member

        Yes, that's why it is a "workaround". :) I was playing with another approach which follows the steps below. Just share it here in case anyone is interested. The problem I tried to solve is not the syntax color highlight, but using some existing Jupyter notebook material if the SME already built them.

         

        Using nbviewer

        nbviewer is a web service that renders Jupyter Notebooks as static web pages.

        1. Upload: Upload your notebook to a public repository like GitHub.

         

        2. Get nbviewer URL: Visit the nbviewer website and enter the URL of your notebook.

         

        3. Embed: Use the URL provided by nbviewer in your iframe. 

        Here is what it looks like in Rise. The embedded notebook reserved all the codes in their colors. 

         

         

    • PhilFoss's avatar
      PhilFoss
      Community Member

      thanks for sharing that Kayla, and SashaVodnik-857 depending on your setup you could actually host that css file yourself to make it more of a global include, so all courses load the same css file. Otherwise it would be a pain if you needed to change a color value across all courses. I don't like creating external dependencies like this, but depending on your LMS setup you could point to a file that resides in your LMS/server so its not really an 'external' file.