18 lines
289 B
Perl
Executable File
18 lines
289 B
Perl
Executable File
#!/usr/bin/env perl
|
|
|
|
use 5.34.0;
|
|
|
|
use Path::Tiny;
|
|
|
|
my $dir = path(shift);
|
|
|
|
$dir->visit(sub{
|
|
my( $path ) = @_;
|
|
return unless $path =~ /\.md$/;
|
|
|
|
$path->edit(sub{
|
|
s/.*^\# (.*?)$/---\ntitle: "@{[ $1 =~ s(\\)()gr]}"\n---/sm;
|
|
});
|
|
},{ recurse => 1});
|
|
|