emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Proposal for images in markdown export (ox-md)


From: John Hendy
Subject: [O] Proposal for images in markdown export (ox-md)
Date: Sun, 9 Feb 2014 18:21:51 -0600

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 <img ... > 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)

<div class="center">
![nil](./img.png)
</div>

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 <div> 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:

<div class="figure"><p><img ... /></div>

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]