Skip to content

Instantly share code, notes, and snippets.

@uzluisf
Created September 25, 2019 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uzluisf/ec9fa34e603bdc11d5e84642e6d74ddc to your computer and use it in GitHub Desktop.
Save uzluisf/ec9fa34e603bdc11d5e84642e6d74ddc to your computer and use it in GitHub Desktop.
The Markdown output when running p6doc --doc=Markdown sample-code.p6 > ...

sub happy-birthday

sub happy-birthday(
    Str $name,
    Int $age
) returns Mu

Say Happy Birthday to a person.

class Mu $

Person's name

class Mu $

Person's age

sub greet

sub greet(
    Str $name,
    Str $greeting = "Hello"
) returns Mu

Greet a person.

class Mu $

Person's name

class Mu $

Greeting

sub happy-birthday

sub happy-birthday(
    Str $name,
    Int $age
) returns Mu

Say Happy Birthday to a person.

class Str $name

Person's name

class Int $age

Person's age

sub greet

sub greet(
    Str $name,
    Str $greeting = "Hello"
) returns Mu

Greet a person.

class Str $name

Person's name

class Str $greeting = "Hello"

Greeting

#| Say Happy Birthday to a person.
sub happy-birthday(
Str $name, #= Person's name
Int $age #= Person's age
) {
say "Happy {$age}th Birthday $name!";
}
#| Greet a person.
sub greet(
Str $name, #= Person's name
Str $greeting = 'Hello' #= Greeting
) {
say "{$greeting.tc}, $name!";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment