Course of Raku / Advanced / Testing and documentation 🆕 / Documenting code 🆕

Formatting and code

Within Pod text you mark up words with single-letter formatting codes, written as a letter followed by angle brackets around the text:

  • B<…> — bold
  • I<…> — italic
  • C<…> — code (monospace)
  • L<…> — a link
=begin pod

This is B<important>, and C<say> is a built-in.

=end pod

When rendered, important appears in bold and say in a code font. The codes nest and can be combined, so B<C<say>> is bold code.

For a whole block of code rather than an inline snippet, use a delimited code block — =begin code … =end code — which preserves the text verbatim:

=begin pod

Here is how to call it:

=begin code
say greet('world');
=end code

=end pod

The lines inside the code block are shown exactly as written, without being interpreted as Pod. Between the inline codes and code blocks, Pod can document an API with formatted prose and runnable-looking examples, all kept next to the code it describes.

Course navigation

Quiz — Pod   |   Rendering Pod


💪 Or jump directly to the exercises in this section.