--- /dev/null
+Return-Path: <too@guru.guru-group.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 624C0429E5B\r
+ for <notmuch@notmuchmail.org>; Wed, 1 Feb 2012 07:22:55 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id s69OosxUxL9X for <notmuch@notmuchmail.org>;\r
+ Wed, 1 Feb 2012 07:22:54 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66])\r
+ by olra.theworths.org (Postfix) with ESMTP id 18596429E34\r
+ for <notmuch@notmuchmail.org>; Wed, 1 Feb 2012 07:22:54 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id EA80768055; Wed, 1 Feb 2012 17:22:56 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] devel: added newssplit.pl for splitting NEWS for markdown\r
+ processing.\r
+Date: Wed, 1 Feb 2012 17:22:50 +0200\r
+Message-Id: <1328109770-29279-2-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.7.6.1\r
+In-Reply-To: <1328109770-29279-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1328109770-29279-1-git-send-email-tomi.ollila@iki.fi>\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 01 Feb 2012 15:22:55 -0000\r
+\r
+devel/newssplit.pl splits NEWS file to separate files per release.\r
+\r
+In addition to splitting it changes lines starting with '*' to start\r
+with '###' (markdown for h3) and concatenates continuing non-empty\r
+lines to the same line; markdown does now allow (long) header line\r
+to be split into multiple lines -- such long lines would look ugly\r
+when reading the original NEWS file in text format.\r
+---\r
+See http://notmuchmail.org/news/ (as of 2012-02-01) to see current\r
+output\r
+ devel/newssplit.pl | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+ 1 files changed, 56 insertions(+), 0 deletions(-)\r
+ create mode 100755 devel/newssplit.pl\r
+\r
+diff --git a/devel/newssplit.pl b/devel/newssplit.pl\r
+new file mode 100755\r
+index 0000000..c1a0b26\r
+--- /dev/null\r
++++ b/devel/newssplit.pl\r
+@@ -0,0 +1,56 @@\r
++#!/usr/bin/perl\r
++# Author: Tomi Ollila\r
++# License: same as notmuch\r
++\r
++# This program is used to split NEWS file to separate (mdwn) files \r
++# for notmuch wiki. Example run:\r
++#\r
++# $ ./devel/newssplit.pl NEWS ../notmuch-wiki/news\r
++\r
++use strict;\r
++use warnings;\r
++\r
++die "$0 <source-file> <destination-directory>\n" unless @ARGV == 2;\r
++\r
++die "'$ARGV[0]': no such file\n" unless -f $ARGV[0];\r
++die "'$ARGV[1]': no such directory\n" unless -d $ARGV[1];\r
++\r
++open I, '<', $ARGV[0] or die "Cannot open '$ARGV[0]': $!\n";\r
++\r
++open O, '>', '/dev/null' or die $!;\r
++my @emptylines = ();\r
++print "\nWriting to $ARGV[1]: ";\r
++while (<I>)\r
++{\r
++ # The date part in regex regognizes wip version dates like: (201x-xx-xx).\r
++ if (/^Notmuch\s+(\S+)\s+\((\w\w\w\w-\w\w-\w\w)\)/) {\r
++ # open O... autocloses previously opened file.\r
++ open O, '>', "$ARGV[1]/release-$1.mdwn" or die $!;\r
++ print " release-$1.mdwn...";\r
++ print O "[[!meta date=\"$2\"]]\n\n";\r
++ @emptylines = ();\r
++ }\r
++ # buffer "trailing" empty lines -- dropped at end of file. \r
++ push(@emptylines, $_), next if s/^\s*$/\n/;\r
++ if (@emptylines) {\r
++ print O @emptylines;\r
++ @emptylines = ();\r
++ }\r
++ # convert top-level list item to level 4 header.\r
++ if (s/^\*\s+//) {\r
++ chomp;\r
++ my @l = $_;\r
++ while (<I>) {\r
++ last if /^\s*$/;\r
++ chomp; s/^\s+//;\r
++ push @l, $_;\r
++ }\r
++ print O "### ", (join ' ', @l), "\n";\r
++ @emptylines = ( "\n" );\r
++ next;\r
++ }\r
++\r
++ print O $_;\r
++}\r
++print "\ndone.\n";\r
++close O;\r
+-- \r
+1.7.6.5\r
+\r