Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
36 lines (32 loc) · 890 Bytes

File metadata and controls

executable file
·
36 lines (32 loc) · 890 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env perl
use 5.036;
use utf8;
use open ':std', ':encoding(UTF-8)';
use Sq -sig => 1;
# read info about examples - when file doesn't exists $info will be empty hash
my $info =
Sq->fs
->read_text('examples', 'info.txt')
->trim
->rxm(qr/\A \s*+ (?= [^#] ) (\S++) \s++ (.++)\z/x)
->merge->as_hash;
# built array of array with info
my $examples =
Sq->fs
->children('examples')
->keep (call 'is_file')
->keep (sub($str) { Str->ends_with($str->stringify, '.pl') })
->sort (by_str)
->choose (sub($file) {
my $name = $file->basename;
return None if $name eq 'info.txt';
return Some(sq [$name, $info->{$name} // ""]);
});
# $Sq::Dump::Inline = 120;
# dump($examples);
# print Array of Array as Table
Sq->fmt->table({
header => [qw/Script Description/],
data => $examples,
border => 0,
});
Morty Proxy This is a proxified and sanitized view of the page, visit original site.