Course of Raku / Advanced / Testing and documentation 🆕 / Documenting code 🆕 / Exercises / Formatted text
Solution: Formatted text
Here is a possible solution to the task.
Code
=begin pod
=head1 Greeting
Hello, B<world>!
=end pod🦋 You can find the source code in the file formatted-text.raku.
Output
Run with raku --doc:
Greeting
Hello, world!Comments
B<world>marks the word bold; in plain-text rendering it appears as ordinary text, but richer formats show it in bold.raku --docrenders the Pod without running any program code.To actually see the bold, render to a format that carries styling. Install a formatter such as
Pod::To::HTMLwithzef install Pod::To::HTML, then runraku --doc=HTML formatted-text.raku; the word now comes out wrapped in an HTML<b>element. Plain--doctext output, by contrast, has no way to show bold once it is written to a file or a pipe.
Course navigation
← Formatted text | A Pod section →