Contents

Code

Put code on a slide with syntax highlighting

Insert a code block, choose its language and show line numbers. The code stays editable text in the slide’s colors.

A Python function on a white slide with line numbers 1 to 7. The keywords def, for, in, try, return, except and raise are orange, the string “gave up” is brown, and the function name retry is bold.

A code block keeps your code as text you can fix on the slide. It’s highlighted in the slide’s color scheme.

Add a code block

  1. Choose Insert › Code Block. A code box appears on the slide. Start typing.
  2. Type your code, or paste it from your editor.
  3. Press Esc when done.

Choose the language and line numbers

  1. Select the code box. In the inspector, click Text and find the Code section.
  2. Choose the language from the Language menu.
  3. Select Line numbers to number each line.
The Code section of the Text tab, with Language set to Python and Line numbers selected.

The languages are Bash, C, C#, C++, CSS, Diff, Go, HTML and XML, Java, JavaScript, JSON, Kotlin, Markdown, PHP, Python, Ruby, Rust, SQL, Swift, TypeScript and YAML. Plain text shows the code without highlighting.

Keywords and numbers take the scheme’s accent color. Strings take a blend of the accent and the text color. Function and class names turn bold, and comments are muted. The code is set in the design’s monospaced font.

Fit the box to the code

If code runs past the box, a small red mark appears at the box’s corner. Click it to grow the box to the code’s height. Or double-click the box’s right handle to widen it to the longest line.

In the Markdown file

The code is an ordinary fenced block in the presentation’s presentation.md. The language follows the backticks, and {lines:true} adds line numbers:

```python {lines:true}
def retry(call, attempts=3):
    for attempt in range(attempts):
```

Download the finished presentation (ZIP)

Unzip it, then open the folder inside in MarkdownPoint.

Written for MarkdownPoint 0.8.4. On Windows, press Ctrl for ⌘ and Alt for ⌥.