updux/contrib/api_grooming.pl
2024-08-08 09:28:44 -04:00

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});