From: Arun Isaac <theroarofthedragon@gmail.com>
To: Emacs orgmode <emacs-orgmode@gnu.org>
Subject: Re: Publishing images to various sizes
Date: Sun, 27 Dec 2015 09:30:35 +0530 [thread overview]
Message-ID: <87y4cg4k2k.fsf@gmail.com> (raw)
In-Reply-To: <m2ege8r81k.fsf@andrew.cmu.edu> (John Kitchin's message of "Sat, 26 Dec 2015 20:31:51 -0500")
John Kitchin <jkitchin@andrew.cmu.edu> writes:
> (defun my-link-format (link contents info)
> (let ((type (org-element-property :type link))
> (path (org-element-property :path link)))
> (cond
> ((and
> (string= type "file")
> (string-match "\.pdf" path))
> (shell-command
> (format
> "convert %s %s"
> path
> (replace-regexp-in-string "\.pdf" ".png" path)))
> (format "<img src=\"%s\">" (replace-regexp-in-string "\.pdf" ".png" path)))
> ;; anything else, we just do the regular thing
> (t
> (org-html-link link contents info)))))
>
> (org-export-define-derived-backend 'my-html 'html
> :translate-alist '((link . my-link-format)))
>
> (browse-url (org-export-to-file 'my-html "custom-link.html"))
Thank you. I'll adapt this to my needs.
Regards,
Arun Isaac
prev parent reply other threads:[~2015-12-27 4:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-24 20:26 Publishing images to various sizes Arun Isaac
2015-12-27 1:31 ` John Kitchin
2015-12-27 4:00 ` Arun Isaac [this message]
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=87y4cg4k2k.fsf@gmail.com \
--to=theroarofthedragon@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).