Udemy now supports syntax highlighting for code blocks and inline code within the Questions and Answers, Quizzes, and Articles.
How to Add Inline Code
Inline code is great to use when you want to highlight a short snippet of code (for example: the definition of a function or the name of a variable) inside a paragraph.
- Navigate to the question or answer box where you want to add your code. If you want to attach your code to a question, type your question first.
- Then click, Ask a new question
- Fill in what you want to say
- Highlight the portion that you want to change to inline code
- Click on the inline code icon in the tool bar
- Click either Post Question or Add an answer
How to Add Code Blocks
Code blocks are great when you want to highlight multiple lines of code.
- Navigate to the question or answer box where you wish to enter your code block
- If you want to attach your code to a question type your question first.
- Enter the code block you wish to include and highlight it
- Click on the inline code icon in the tool bar
- Then click either Post Question or Add an answer
- Your inline code should be nicely highlighted!
Where to Use Code Blocks And Inline Code
Questions & Answers - Highlighting your code inside questions and answers makes it easier and faster for students to read it and share their feedback.
Quizzes - Highlight your code in the questions of a quiz and in the answers. This allows instructors to ask questions such as “Which is the correct way to solve this problem?” and prompt students to choose the correct answer from a set of different implementations.
Articles - Highlight your code in articles so that students can easily read and learn from it.