emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Paul Sexton <psexton.2a@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Markdown export (using org-export-generic)
Date: Wed, 17 Aug 2011 02:20:36 +0000 (UTC)	[thread overview]
Message-ID: <loom.20110817T041405-33@post.gmane.org> (raw)

Wes Hardaker's org-export-generic (in worg) does a pretty good job of 
exporting to markdown syntax. The following works (use C-c C-e g to 
run the exporter):

(require 'org-export-generic)
(org-set-generic-type
 "markdown" 
 '(:file-suffix     ".markdown"
   :key-binding     ?M
   :title-format    "Title: %s\n"
   :date-format     "Date: %s\n"
   :toc-export      nil
   :author-export   t
   :tags-export     nil
   :drawers-export  nil
   :date-export     t
   :timestamps-export  t
   :priorities-export  nil
   :todo-keywords-export t
   :body-line-fixed-format "\t%s\n"
   ;:body-list-prefix "\n"
   :body-list-format "- %s"
   :body-list-suffix "\n"
   :header-prefix ("" "" "### " "#### " "##### " "###### ")
   :body-section-header-prefix ("" "" "### " "#### " "##### " "###### ")
   :body-section-header-format "%s\n"
   :body-section-header-suffix (?= ?- "")
   :body-header-section-numbers nil
   :body-header-section-number-format "%s) "
   :body-line-format "%s\n"
   :body-newline-paragraph "\n"
   :bold-format "**%s**"
   :italic-format "_%s_"
   :verbatim-format "`%s`"
   :code-format "`%s`"
   :body-line-wrap   75
   ))

There are some defects however, which an't really be fixed without altering
the exporter code. The main ones are:

1. Nested lists don't seem to be supported.

2. Tables come out as:

col 1    col 2
-------+-------
     1       2
     3       4

But need to look like this:

|col 1  | col 2 |
|-------|-------|
|     1 |      2|
|     3 |      4|

3. Links are not exported correctly.

A link [[http://www.google.com][like this]] comes out as

A link [like this]
...
[like this]: http://www.google.com

But need to look either like:

A link [like this][1]
...
[1]: http://www.google.com

Or like:

A link [like this](http://www.google.com)

Paul

             reply	other threads:[~2011-08-17  2:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-17  2:20 Paul Sexton [this message]
2011-08-17  2:38 ` Markdown export (using org-export-generic) Jambunathan K
2011-08-17 21:16   ` Paul Sexton
2011-08-17 22:26     ` Jambunathan K
2011-08-17 22:49       ` Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20110817T041405-33@post.gmane.org \
    --to=psexton.2a@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).