From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Erik Edrosa Newsgroups: gmane.lisp.guile.user Subject: Re: [ANN] guile-commonmark 0.1 (A markdown parser) Date: Mon, 25 Jul 2016 20:58:25 -0400 Message-ID: <26c87576-fce7-69b7-b2e1-39b8979ae4a7@gmail.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1469494745 9815 80.91.229.3 (26 Jul 2016 00:59:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Jul 2016 00:59:05 +0000 (UTC) Cc: "guile-user@gnu.org" To: "Thompson, David" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Jul 26 02:58:56 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bRqhz-00061d-KG for guile-user@m.gmane.org; Tue, 26 Jul 2016 02:58:55 +0200 Original-Received: from localhost ([::1]:36500 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRqhy-0006FW-Oe for guile-user@m.gmane.org; Mon, 25 Jul 2016 20:58:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRqha-0006FD-GG for guile-user@gnu.org; Mon, 25 Jul 2016 20:58:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRqhZ-0005ka-As for guile-user@gnu.org; Mon, 25 Jul 2016 20:58:30 -0400 Original-Received: from mail-io0-x232.google.com ([2607:f8b0:4001:c06::232]:33046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRqhZ-0005kW-5y for guile-user@gnu.org; Mon, 25 Jul 2016 20:58:29 -0400 Original-Received: by mail-io0-x232.google.com with SMTP id 38so185913916iol.0 for ; Mon, 25 Jul 2016 17:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=MMjCP1f+OEw0pui6a68CU3gpbih828VKmpuDWXIQ+cs=; b=hodkhcAxN1q9ygyR019z7zwk+OdMraSgrHSCa44PG5NhsemkTrwcVpqVConeQryCEq 1dSv+wZNuXLbXVrPD+xmN91y1P2nmM+06wcXTnZWqqnsLu/slgM04JbXewSqvaRHwRx9 DOf5JGrCc1t7yrjBiHG5dQx3WIt6UZ5OZwOieAk93St3de5VwJ2+JQe6B3h9IZszEneX 9dmurkueZR6MJN+NB4TBqKvtAbanIgvFAQPjgcgO86mlgtMG6C5InoeLBDjWDSRREYwc UD4iYrI3vb9Myan6ziEPaYBJRsnG5iTJzS6Uk4zkdaR4KMeQf22J+sSqpxGz3efLeoxu XX+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=MMjCP1f+OEw0pui6a68CU3gpbih828VKmpuDWXIQ+cs=; b=Cl88XnuWQCK4Ddx8uduZzVAigPKOGaVR5ztjQd4965zYyLU+X2n7fz4AaioR2RuR9t NthSp7XifExhfThEj/EjGDCNfIu5e89wtrPtttj4Sukc+6IGEtdCOblpNBGpbHr+MY8S DI8gFI0cPap/TH0/dyVD0VjQHilgsTIlcKnV9BRPJgKkSV3ei5rWI1aWegpONAzZwdra DKbno0/eeMXnHPDqaaf8qyMZl0m9Ij2TA9IxZfFgyJCczvzQmGpWrPM/V7SSvE0dSmwN 5s0gs/s1vROUHWzWuAkCdnF9nflApFPLXyo33e4UwO/Fjvo/hffDnxvb+1ggfae7kRt+ DAFg== X-Gm-Message-State: AEkoouuMSxN50sSEaiL6RgpeCBGryQKlZig10UvYl3ejQjEI3X+WUPkGj5yM745R5bw12A== X-Received: by 10.202.172.135 with SMTP id v129mr11416615oie.140.1469494708088; Mon, 25 Jul 2016 17:58:28 -0700 (PDT) Original-Received: from ?IPv6:2602:306:c5c9:a3e0:be5f:f4ff:fe45:6041? ([2602:306:c5c9:a3e0:be5f:f4ff:fe45:6041]) by smtp.googlemail.com with ESMTPSA id 59sm12357792otw.9.2016.07.25.17.58.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jul 2016 17:58:27 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c06::232 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:12794 Archived-At: On 07/25/2016 09:44 AM, Thompson, David wrote: > On Sun, Jul 24, 2016 at 10:33 PM, Erik Edrosa wrote: >> >> As a bonus for haunt users, here is an example using guile-commonmark as >> a reader to generate a blog written in markdown. >> >> (use-modules (haunt asset) >> (haunt builder blog) >> (haunt builder atom) >> (haunt reader) >> (haunt site) >> (haunt post) >> (commonmark)) >> >> (define commonmark-reader >> (make-reader (make-file-extension-matcher "md") >> (lambda (file) >> (call-with-input-file file >> (lambda (port) >> (values (read-metadata-headers port) >> (commonmark->sxml port))))))) >> >> (site #:title "Built with Guile" >> #:domain "example.com" >> #:default-metadata >> '((author . "Eva Luator") >> (email . "eva@example.com")) >> #:readers (list commonmark-reader) >> #:builders (list (blog) >> (atom-feed) >> (atom-feeds-by-tag))) >> >> Now just save the above as haunt.scm and put your markdown blog posts in >> the posts directory with a .md extension and run `haunt build`. Here is >> an example blog post: >> >> title: Hello World! >> date: 2016-07-24 10:00 >> tags: guile, commonmark, scheme >> --- >> >> A CommonMark Document >> =============== >> Here is some *scheme* `code` >> ```scheme >> (display "Hello, World!") >> ``` >> >> 1. A list >> 2. Another item in a list >> >> Read more about [CommonMark](http://commonmark.org/) >> >> >> Please note the header on top portion of the post which allows you to >> add metadata to your blog posts for haunt. > > This is just wonderful! Thank you! > > If you have the time/motivation, I would love to see a patch to Haunt > itself that adds guile-commonmark as an optional dependency. There's > prior art for this because guile-reader is also optional, so it would > mostly be a copy/paste job in configure.ac and Makefile.am to > conditionally include the markdown reader module in the list of source > modules. > > - Dave > Definitely, I have been playing around with haunt and managed to switch my current blog to use haunt and guile-commonmark. I have a couple of ideas to add to haunt, so I will hopefully be sending you some patches soon. Thanks, Erik