From: John Hendy <jw.hendy@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Proposal for images in markdown export (ox-md)
Date: Sun, 9 Feb 2014 18:21:51 -0600 [thread overview]
Message-ID: <CA+M2ft8EmSzvwEH5JybBkw46bFZn84e9u64YN_kUY+tN=7NKBQ@mail.gmail.com> (raw)
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
next reply other threads:[~2014-02-10 0:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-10 0:21 John Hendy [this message]
2014-02-10 9:07 ` Proposal for images in markdown export (ox-md) Bastien
2014-02-10 16:43 ` Nicolas Goaziou
2014-02-10 17:03 ` John Hendy
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='CA+M2ft8EmSzvwEH5JybBkw46bFZn84e9u64YN_kUY+tN=7NKBQ@mail.gmail.com' \
--to=jw.hendy@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).