updux/contrib/api_grooming.pl

18 lines
289 B
Perl
Raw Permalink Normal View History

2024-08-08 13:28:44 +00:00
#!/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});