From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Proposal for images in markdown export (ox-md) Date: Sun, 9 Feb 2014 18:21:51 -0600 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCedF-0000YX-5u for emacs-orgmode@gnu.org; Sun, 09 Feb 2014 19:21:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCedE-0001SW-4Q for emacs-orgmode@gnu.org; Sun, 09 Feb 2014 19:21:53 -0500 Received: from mail-oa0-x229.google.com ([2607:f8b0:4003:c02::229]:50158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCedD-0001SR-VB for emacs-orgmode@gnu.org; Sun, 09 Feb 2014 19:21:52 -0500 Received: by mail-oa0-f41.google.com with SMTP id j17so6818301oag.0 for ; Sun, 09 Feb 2014 16:21:51 -0800 (PST) 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: emacs-orgmode Hi, I've been playing around with the ox-md lately and wondered about the idea of shifting the exported image syntax if any html options are present. While the markdown file could be changed prior to re-export to something else, it would seem that specifying options in Org might imply they want might want those options applied to the markdown file as well. Or I'm perhaps wrong about this given the aim of markdown, but in that case I'd at least propose a change to the current behavior of #+begin/end_center. The current behavior is such that no image attributes can be specified (that I've found), which sort of makes sense given that markdown doesn't have any image tweaking syntax. If you google around on how to do this, the answer is simply to use straight html instead of the typical ![description](/path/to/image.png) format. So, my proposal would be that if either are present, Org could (should?) use html image specifications instead of markdown. 2) Behavior with centering: - org #+begin_center [[./img.png]] #+end_center - exported to markdown (doesn't work when converting to .html)
![nil](./img.png)
2) attributes - org #+attr_html: :style display: block; margin-left: auto; margin-right: auto; height: 400px [[./img.png]] - markdown ![nil](./img.png) The second works in that the image is displayed as-is from the file. For conversion from .md to something else, this only works if the image is the exact size required for the resultant document. I'd prefer not to have to resize every image I want to use in a markdown document just for that markdown document. I'm a bit confused about the
behavior, as I've encountered at least one suggestion that this should work, but at least with knitr and knit2html, this doesn't render properly (it just prints the verbatim text, "![nil](./img.png)"). - http://stackoverflow.com/a/1228126/495990 Is there a reason Org uses this for #+begin_center? The documentation says that the html backend behavior will be used where ox-md doesn't have support, and the html behavior for #+begin/end_center is to export an image like so:

There's corresponding css in the header for the figure class: .figure { padding: 1em; } .figure p { text-align: center; } Based, on this, one *might* make the case that ox-html should take over when attributes are specified. Just one thought process :) Thanks for any feedback, John