John Kitchin <jkitc...@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

Reply via email to