Contents:
How instructions work in Code Classroom
You can add instructions to any project you share with students. They appear alongside the code.
Students see a read-only version of the instructions.
Students get their own copy of a project when they start it. This means changes you make to the code or instructions later will not reach anyone who has already started.
How to write instructions
Project instructions are written and edited in a format called Markdown.
You can preview what the student will see by switching to View mode.
Text styling
You can style text with bold, italic and strikethrough by wrapping it in symbols.
Example:
**Bold text** draws attention to a word. _Italic text_ is useful for emphasis. **_Bold and italic** works too. ~~Strikethrough~~ shows something that has changed.
Headings
Start a line with #. Add more # characters for a smaller heading.
Example:
# Heading level 1 ## Heading level 2 ### Heading level 3
Paragraphs and line breaks
Leave a blank line between two blocks of text to start a new paragraph.
To start a new line without starting a new paragraph, end the line with a backslash \.
Example:
First line\ Second line A new paragraph
Links
Put the link text in square brackets, followed by the web address in round brackets.
Example:
Link to a website like this: [Raspberry Pi Foundation](https://www.raspberrypi.org).
Lists
To create bullet points, use a - at the start of each line.
Example:
- Add a sprite - Add a backdrop - Add some code
To create a numbered list, use numbers followed by a full stop: 1., 2., 3. and so on
Example:
1. Open the file `main.py` 2. Type your code 3. Click **Run**
To put a list inside another list, indent it by two spaces.
Example:
- Shapes - Square - Circle
Code
Use single backticks to show code within a sentence.
Example:
Use the `print()` function to show a message.
Code blocks
For longer code blocks, use three backticks and name the language so that the code is coloured.
You can use python, html, css or javascript. Leave the language out if you do not want coloured code.
Example:
```python
name = input("What is your name? ")
print("Hello, " + name)
```
Block type
You can highlight text with the same colours as the block types to help students understand your instructions.
`Highlighted text`{:block-type="TYPE"}
The different types you can use are:
- control
- events
- extensions
- looks
- motion
- myblocks
- operators
- sensing
- sound
- variables
Example:
Use the `Motion`{:block-type="motion"} blocks to customise your sprite
Blocks code
In a Blocks project, use blocks as the language name in a code block to show real blocks. Use [ ] for text inputs and ( ) for number inputs. For more information on how to write blocks as text, see the block syntax reference.
Example:
```blocks when green flag clicked say [Hello!] for (2) seconds ```
Horizontal lines
Three dashes on their own line create a divider.
Example:
---
Turning off formatting
Put a backslash \ before a symbol to show the symbol itself, instead of using it to format the text.
Example:
\_This is not italic\_