Debug

Annotations allow you to change how the code is displayed and also to add interactivity.

There are two ways to add annotations:

  • using the codeblock metastring
  • using comments inside the code

_8
```py focus=2
_8
print(1)
_8
print(2)
_8
print(3)
_8
# focus
_8
print(4)
_8
print(5)
_8
```

focus is only one of the possible annotations. The full list is:

  • focus: keep the targeted code bright while dimming the rest
  • mark: add a background color to the targeted tokens
  • link: add links inside the code

First let's see the syntax to target different parts of the code.

Targeting lines and columns

To select a specific line, use the line number: focus=2

To select a range of lines use a colon: focus=3:5

Select a range of column from a line using brackets: focus=5[3:6]

Combine selectors using a comma separated list: focus=1,3:5,7[1:4,7:9]


_7
123456789
_7
123456789
_7
123456789
_7
123456789
_7
123456789
_7
123456789
_7
123456789

Comment syntax