summaryrefslogtreecommitdiff
path: root/vendor/bundle/ruby/3.4.0/gems/rouge-4.7.0/lib/rouge/demos/mason
blob: 70d4338db36ce0678111664d72037a4733c2ed9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<%doc>
    This is a mason component.
    # This is a comment.
</%doc>

<%args>
    $color         # this argument is required!
    $size => 20    # default size
    $country => undef   # this argument is optional, default value is 'undef'
    @items => (1, 2, 'something else')
    %pairs => (name => "John", age => 29)
</%args>

% # A random block of Perl code
<%perl>
    my @people = ('mary' 'john' 'pete' 'david');
</%perl>

% # Note how each line of code begins with the mandatory %
% foreach my $person (@people) {
    Name: <% $person %>
% }