Forum Discussion

stichbury's avatar
stichbury
Community Member
23 hours ago

How to customize text block in Rise 360 to show code

Hi there,

I'm writing a training course/tutorial that involves code creation in Python. I want to include a block of text that shows some code snippets (Python). I'd typically show these in Courier font, indented, maybe with highlighted terms in different colours. Like this blog post, really https://medium.com/data-science-collective/model-context-protocol-in-net-06c6076b6385

 

I can't work out how to customize a paragraph of text to use a different font. The options enable me to change size, italicise, bold etc, but there's no font option. Courier font is a standard font -- do I have to customize the theme somehow? 

2 Replies

  • DavidSwaddle's avatar
    DavidSwaddle
    Community Member

    Is what you're looking for covered in the Code Snippet block type? It's in the Multimedia block group.

    You don't get any formatting control in the code, and it doesn't do semantic highlighting, but it does display with a Courier font and a grey background.

    Alternatively, you could get more control with a Custom Block, but that doesn't seem to have a Courier font as an option and can't use web fonts. You could do the semantic highlighting there. This breaks responsiveness.

    Or, maybe you could create the CSS formatted code example externally and then insert it using one of the new Code blocks. That's not very elegant, breaks responsiveness, but might give you the most flexibility. I haven't tried it, but it seems logical.

    • stichbury's avatar
      stichbury
      Community Member

      Wow, thank you. I hadn't found that in the multimedia section, but that will do it. I had tried the Code block but that definitely didn't seem the most elegant solution. Appreciate the help, thanks DavidSwaddle​