From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Rettke Subject: Re: Add-on: Github Flavored Markdown exporter Date: Tue, 8 Apr 2014 21:06:23 -0500 Message-ID: References: <87a9bwbx6t.fsf@gmail.com> <878urg12im.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXhuH-0007l7-5Q for emacs-orgmode@gnu.org; Tue, 08 Apr 2014 22:06:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXhuF-00024n-Kl for emacs-orgmode@gnu.org; Tue, 08 Apr 2014 22:06:28 -0400 Received: from mail-ob0-x230.google.com ([2607:f8b0:4003:c01::230]:45832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXhuF-00024A-Cl for emacs-orgmode@gnu.org; Tue, 08 Apr 2014 22:06:27 -0400 Received: by mail-ob0-f176.google.com with SMTP id wp18so1992052obc.35 for ; Tue, 08 Apr 2014 19:06:23 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Lars Tveito Cc: "emacs-orgmode@gnu.org" , Thorsten Jolitz Dumb question, from where should we pull down your excellent exporter Lars? Grant Rettke | AAAS, ACM, AMA, COG, FSF, IEEE, Sigma Xi grettke@acm.org | http://www.wisdomandwonder.com/ =E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates ((=CE=BB (x) (x x)) (=CE=BB (x) (x x))) =E2=80=9CLife has become immeasurably better since I have been forced to st= op taking it seriously.=E2=80=9D --Thompson On Tue, Apr 8, 2014 at 4:39 PM, Lars Tveito wrote: > Hi, thanks for checking it out! > > Thorsten Jolitz writes: > >> Thorsten Jolitz writes: >> >>> Lars Tveito writes: >>> >>>> Hi! >>>> >>>> I have written an exporter for Github Flavored Markdown, which is a >>>> derived back-end from the Markdown (vanilla) exporter. It adds >>>> Github-style src-blocks, strike-through and table of contents. >> >> Your library works really good, thanks. I would recommend adding it to >> /contrib. I used it to create new README.md files for all three >> libraries navi-mode.el, outorg.el and outshine.el, you can find the >> repos on github.com/tj64 if you want to take a look. >> > > I try adding it soon. Checked out your README'S, looks good! > >> I like the idea very much to write this documentation stuff once in one >> place and then reuse it in all other places. Therefore when I write a >> source file, I use outorg to write a more or less sophisticated comment >> header for that file. This is then automatically converted back to a >> programming language comment section, but I can always convert it back >> to Org-mode. From the outorg-edit-buffer, I can then export it to html, >> latex, ascii and now to markdown-github-flavor too, whats nice. >> >> I use a little trick to do this: >> I narrow the buffer to the first 1st level headline, and then use >> >> ,-------------- >> | C-1 M-# M-# >> | C-u 1 M-# M-# >> `-------------- >> >> to temporarily insert the default export template, or >> >> ,-------------- >> | C-3 M-# M-# >> | C-u 3 M-# M-# >> `-------------- >> >> to temporarily insert a custom export template from a file. >> >> A few questions and remarks: >> >> - I get the best results with just using example blocks - is it supposed >> to work with source-blocks and other blocks too? >> > > Getting it to work with source-blocks was the feature I missed the most > from the vanilla markdown exporter. If you specify a language in the > source-block it will be added to the exported version as well; a problem > occurs if you specify a language not supported by Github. Emacs lisp is > an example of this, so there is a alist `org-gfm-lang' which by default > has the value: > > (("emacs-lisp" . "lisp") ("elisp" . "lisp")) > > So a source block like this: > > #+begin_src emacs-lisp > (defun foo () > 'foo) > #+end_src > > exports to this: > > ```lisp > (defun foo () > 'foo) > ``` > > Which provides syntax highlighting in Github Flavored Markdown. > >> - Just like the Org exporter in general, it does not know how to deal >> with boxes made with rebox2.el, so I replaced them with example >> blocks. >> > > I am not familiar with rebox2.el. This back-end inherits most > functionality from the markdown (vanilla) exporter, which again inherits > from the html exporter. Since rebox2.el doesn't play nice with any of > those it will cause problems with the github flavored as well. > > If you'd like the boxes created with rebox2.el to appear in the exported > version you could possibly wrap it inside an example-block. > >> - What about numbered lists with longer text/blocks as item content - is >> the item numbering supposed to work? > > I hadn't tested this, but found an old org-file with notes packed with > different lists. I generated it, and most of it looks good: > https://gist.github.com/anonymous/694b7b5f53dd21850bcd (by the way, the > content is rubbish, and in Norwegian). > > The only problems are with latex-code mixed in the document and sloppy > work from the original org file. > > - Lars >