Skip to main content

Code blocks

Use fenced code with the correct language. Remarp emits filename labels and line-highlight markers for technical slides.

```python {filename="review.py" highlight="2-3"}
def summarize(checks):
passed = [check for check in checks if check["passed"]]
return len(passed), len(checks)
```

Attributes and highlighting​

A filename identifies the source file. Highlight specifications select individual lines or ranges. Combine supported fence attributes rather than inserting presentation markup into the code itself. Keep excerpts short enough to read; use a code slide for a focused example and speaker notes for explanation.

Diff blocks​

```diff
- timeout = 5
+ timeout = 15
```

diff fences preserve literal - and + lines, but the current Remarp slide renderer has no diff-specific styling. This Docusaurus guide page renders separately from generated slides. For visual change annotations, author HTML/CSS where appropriate and inspect the generated slides.

Code fences may contain Python, JavaScript/TypeScript, YAML, JSON, Bash, or another language supported by the bundled highlighter. Syntax highlighting does not validate or execute the example.

Rendering checks​

Inspect overflow, line wrapping, highlight contrast, filename labels, and the selected slide type. Auto-detection of long code blocks is a convenience; use an explicit type when the intended layout is important.