--- /dev/null
+Return-Path: <wking@tremily.us>\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 2851F431FAE\r
+ for <notmuch@notmuchmail.org>; Sat, 31 May 2014 15:21:19 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\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\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]\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 DQgtdVI3Elzl for <notmuch@notmuchmail.org>;\r
+ Sat, 31 May 2014 15:21:15 -0700 (PDT)\r
+Received: from qmta03.westchester.pa.mail.comcast.net\r
+ (qmta03.westchester.pa.mail.comcast.net [76.96.62.32])\r
+ by olra.theworths.org (Postfix) with ESMTP id 7C01E431FD8\r
+ for <notmuch@notmuchmail.org>; Sat, 31 May 2014 15:21:03 -0700 (PDT)\r
+Received: from omta24.westchester.pa.mail.comcast.net ([76.96.62.76])\r
+ by qmta03.westchester.pa.mail.comcast.net with comcast\r
+ id 8mL81o0031ei1Bg53mM33L; Sat, 31 May 2014 22:21:03 +0000\r
+Received: from odin.tremily.us ([24.18.63.50])\r
+ by omta24.westchester.pa.mail.comcast.net with comcast\r
+ id 8mM11o00f152l3L3kmM2LP; Sat, 31 May 2014 22:21:03 +0000\r
+Received: from mjolnir.tremily.us (unknown [192.168.0.140])\r
+ by odin.tremily.us (Postfix) with ESMTPS id 3DC1311F065C;\r
+ Sat, 31 May 2014 15:21:01 -0700 (PDT)\r
+Received: (nullmailer pid 13199 invoked by uid 1000);\r
+ Sat, 31 May 2014 22:20:38 -0000\r
+From: "W. Trevor King" <wking@tremily.us>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 6/6] nmbug-status: Optionally load the header and footer\r
+ templates from the config\r
+Date: Sat, 31 May 2014 15:20:27 -0700\r
+Message-Id:\r
+ <1d1e7c71bb4b55fc501411381fda5e2421ca6fe2.1401574293.git.wking@tremily.us>\r
+X-Mailer: git-send-email 1.9.1.353.gc66d89d\r
+In-Reply-To: <cover.1401574293.git.wking@tremily.us>\r
+References: <cover.1401574293.git.wking@tremily.us>\r
+In-Reply-To: <cover.1401574293.git.wking@tremily.us>\r
+References: <cover.1401574293.git.wking@tremily.us>\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
+ s=q20140121; t=1401574863;\r
+ bh=iqON0OSdx9Fr65Ee3et5C5RrRmOatQ04fRvSTNG6heY=;\r
+ h=Received:Received:Received:Received:From:To:Subject:Date:\r
+ Message-Id;\r
+ b=htGwYK9t/18IWypQqH+M/crGfgKX+h8liMzVx7pxpumBnY2wo8d/QygEYoL2Kvcut\r
+ mWu7QVRlOCqVK7rptHgOrh5OVF/lkjBFZ2HIFB69ecWaj9cKDEr+Kg2I/2dNppBDIq\r
+ 95Uoj337zN/x/7R6D1hT86e5khQshwShX1DPJWfUTLXwSR+z5sJp10ExeLMDjJ5mAa\r
+ G5U+eX1VQ9oEmMY0LGW7m7k+mQz/R3YsqByT5zEWr79Ntb0+iElaSkdXjQuQPyt2fS\r
+ eTltNyUiyWhze5qyRGKZOMyvOnWdfTe1fuzD41vs3kodoXBi0WEm/THI1h+GT7+bQJ\r
+ qgI5SoB4bkPBA==\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: Sat, 31 May 2014 22:21:19 -0000\r
+\r
+For folks that don't like the default templates for whatever reason.\r
+---\r
+ NEWS | 18 ++++++++++++++++++\r
+ devel/nmbug/nmbug-status | 37 +++++++++++++++++++++----------------\r
+ 2 files changed, 39 insertions(+), 16 deletions(-)\r
+\r
+diff --git a/NEWS b/NEWS\r
+index 5d85733..ab6f9e4 100644\r
+--- a/NEWS\r
++++ b/NEWS\r
+@@ -1,3 +1,21 @@\r
++Notmuch 0.19 (UNRELEASED)\r
++=========================\r
++\r
++nmbug-status\r
++------------\r
++\r
++`nmbug-status` can now optionally load header and footer templates\r
++from the config file. Use something like:\r
++\r
++ {\r
++ "meta": {\r
++ "header": "<!DOCTYPE html>\n<html lang="en">\n...",\r
++ "footer": "</body></html>",\r
++ ...\r
++ },\r
++ ...\r
++ },\r
++\r
+ Notmuch 0.18 (2014-05-06)\r
+ =========================\r
+ \r
+diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status\r
+index c0bdd1b..f0809f1 100755\r
+--- a/devel/nmbug/nmbug-status\r
++++ b/devel/nmbug/nmbug-status\r
+@@ -275,20 +275,8 @@ parser.add_argument('--get-query', help='get query for view',\r
+ args = parser.parse_args()\r
+ \r
+ config = read_config(path=args.config)\r
+-now = datetime.datetime.utcnow()\r
+-context = {\r
+- 'date': now,\r
+- 'datetime': now.strftime('%Y-%m-%d %H:%M:%SZ'),\r
+- 'title': config['meta']['title'],\r
+- 'blurb': config['meta']['blurb'],\r
+- 'encoding': _ENCODING,\r
+- 'inter_message_padding': '0.25em',\r
+- 'border_radius': '0.5em',\r
+- }\r
+ \r
+-_PAGES['text'] = Page()\r
+-_PAGES['html'] = HtmlPage(\r
+- header='''<!DOCTYPE html>\r
++header_template = config['meta'].get('header', '''<!DOCTYPE html>\r
+ <html lang="en">\r
+ <head>\r
+ <meta http-equiv="Content-Type" content="text/html; charset={encoding}" />\r
+@@ -338,13 +326,30 @@ _PAGES['html'] = HtmlPage(\r
+ {blurb}\r
+ </p>\r
+ <h3>Views</h3>\r
+-'''.format(**context),\r
+- footer='''\r
++''')\r
++\r
++footer_template = config['meta'].get('footer', '''\r
+ <hr>\r
+ <p>Generated: {datetime}\r
+ </body>\r
+ </html>\r
+-'''.format(**context),\r
++''')\r
++\r
++now = datetime.datetime.utcnow()\r
++context = {\r
++ 'date': now,\r
++ 'datetime': now.strftime('%Y-%m-%d %H:%M:%SZ'),\r
++ 'title': config['meta']['title'],\r
++ 'blurb': config['meta']['blurb'],\r
++ 'encoding': _ENCODING,\r
++ 'inter_message_padding': '0.25em',\r
++ 'border_radius': '0.5em',\r
++ }\r
++\r
++_PAGES['text'] = Page()\r
++_PAGES['html'] = HtmlPage(\r
++ header=header_template.format(**context),\r
++ footer=footer_template.format(**context),\r
+ )\r
+ \r
+ if args.list_views:\r
+-- \r
+1.9.1.353.gc66d89d\r
+\r