From 3083b7fbe2bc6e8dcd935b10bb7a165257c5252b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 18 Jan 2016 05:18:09 +0000 Subject: doc: convert to perlpod(1) from Markdown perlpod(1) is already installed by default on Debian and RedHat-based systems; and probably most modern *nixes; pandoc(1) (and Haskell) are not. POD also more standardized than Markdown (which flavor? :P), especially for generating manpages. So save any potential documentation editors some disk space by not forcing them to install Haskell and pandoc. Finally, I'm a mildly proficient in Perl and do not know Haskell at all and have a better chance at reading/hacking the source if the document generator breaks. --- Documentation/update-footer.rb | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'Documentation/update-footer.rb') diff --git a/Documentation/update-footer.rb b/Documentation/update-footer.rb index a6e16cb..dfc1b1a 100755 --- a/Documentation/update-footer.rb +++ b/Documentation/update-footer.rb @@ -3,22 +3,26 @@ # License: GPL-3.0+ # frozen_string_literal: true contact = %q{ -All feedback welcome via plain-text mail to: \ -Mailing list archives available at and -\ +All feedback welcome via plain-text mail to: L + +Mailing list archives available at L +and L + No subscription is necessary to post to the mailing list. } copyright = %q{ -Copyright %s all contributors .\ -License: GPL-3.0+ +Copyright %s all contributors L + +License: GPL-3.0+ L } ENV['TZ'] = 'UTC' now_year = Time.now.strftime("%Y") ARGV.each do |file| - cmd = %W(git log --reverse --pretty=format:%ad --date=short -- #{file}) - beg_year = IO.popen(cmd, &:gets).split('-')[0] + cmd = %W(git log --follow -M1 --pretty=format:%ad --date=short + -- #{file}) + beg_year = IO.popen(cmd, &:read).split("\n")[-1].split('-')[0] years = beg_year == now_year ? beg_year : "#{beg_year}-#{now_year}" File.open(file, "r+") do |fp| @@ -27,7 +31,7 @@ ARGV.each do |file| sec = { state => ''.dup } fp.each_line do |l| case l - when /^(#.+)$/ + when /^(=head.+)$/ state = $1.freeze sections << state sec[state] = ''.dup @@ -38,8 +42,8 @@ ARGV.each do |file| fp.truncate(0) fp.rewind - sec["# CONTACT"] = contact - sec["# COPYRIGHT"] = sprintf(copyright, years) + sec["=head1 CONTACT"] = contact + sec["=head1 COPYRIGHT"] = sprintf(copyright, years) while section = sections.shift fp.puts(section) if String === section blob = sec[section].sub(/\A\n+/, '').sub(/\n+\z/, '') -- cgit v1.2.3-24-ge0c7