From e31578045ed0ff2b81955d7a364a67633beb2909 Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Sat, 30 Jun 2018 03:12:06 +0200 Subject: [PATCH] add script for auto-generating links in CHANGELOG [skip ci] --- scripts/markdown-hyperlinks.pl | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 scripts/markdown-hyperlinks.pl diff --git a/scripts/markdown-hyperlinks.pl b/scripts/markdown-hyperlinks.pl new file mode 100755 index 000000000..a09b94e38 --- /dev/null +++ b/scripts/markdown-hyperlinks.pl @@ -0,0 +1,49 @@ +#! /usr/bin/env perl +# +# Re-generate hyperlinks in place: +# +# perl -i scripts/markdown-hyperlinks.pl CHANGELOG.md +# +# Generate to another file: +# +# scripts/markdown-hyperlinks.pl CHANGELOG.md > CHANGELOG-autolink.md + +use strict; +use warnings; + +my $user = qr/ [a-zA-Z] [a-zA-Z0-9]* /x; +my $repo = qr/ [a-zA-Z] [a-zA-Z0-9.-]* /x; + +while (<>) { + + # make links from @username references + # (except when escaped like \@foobar or `@foobar`) + s;(?