From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: copying files in the links while exporting to html Date: Mon, 2 Jun 2014 22:00:17 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1135e62491ae6f04fae4dfed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wre1U-00013o-Dz for emacs-orgmode@gnu.org; Mon, 02 Jun 2014 22:00:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wre1T-00037i-9j for emacs-orgmode@gnu.org; Mon, 02 Jun 2014 22:00:20 -0400 Received: from mail-pd0-x22f.google.com ([2607:f8b0:400e:c02::22f]:58836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wre1S-00037O-Ve for emacs-orgmode@gnu.org; Mon, 02 Jun 2014 22:00:19 -0400 Received: by mail-pd0-f175.google.com with SMTP id z10so4030873pdj.34 for ; Mon, 02 Jun 2014 19:00:17 -0700 (PDT) In-Reply-To: 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: zhenjiang zech xu Cc: "emacs-orgmode@gnu.org" --001a1135e62491ae6f04fae4dfed Content-Type: text/plain; charset=UTF-8 there is no builtin way to do this that I know of. I do this in publishing blogposts from org-mode. i use a filter on links that does this. The copying code is here: https://github.com/jkitchin/jmax/blob/master/user/blogofile.el#L115 the results of that code can be seen at http://kitchingroup.cheme.cmu.edu. I wrote about doing some of this here: http://kitchingroup.cheme.cmu.edu/blog/2013/09/28/Changing-links-to-files-so-they-work-in-a-blog/ It may not be what you want, but it might help you build your code. I hope it helps! John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu On Mon, Jun 2, 2014 at 7:23 PM, zhenjiang zech xu wrote: > Hi orgmoders, > > Is there any existing function to copy files in the external links to a > specified location when exporting .org file to html? I know org-publish has > functionality to copy files with certain suffices on defined project, but > my need is to export single file or single subtree in the buffer. > > For example, when I export the following subtree, it would be lovely to > copy the spam.png to the path I set up. > * foo > [[file:spam.png]] > > If there is no function ready to do that, what is the easiest easy to > implement it? any point to the right direction is appreciated. > > Thanks, > Zhenjiang > --001a1135e62491ae6f04fae4dfed Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
there is no builtin way to do this that I know o= f. I do this in publishing blogposts from org-mode. i use a filter on links= that does this. The copying code is here:

https://github.com/j= kitchin/jmax/blob/master/user/blogofile.el#L115

the results of that code can be seen at http://kitchingroup.cheme.cmu.edu. I wrote about d= oing some of this here: http://kitchingr= oup.cheme.cmu.edu/blog/2013/09/28/Changing-links-to-files-so-they-work-in-a= -blog/

It may not be what you want, but it might help you build your cod= e. I hope it helps!

<= div>John

-----------------------------------
John Kitchin
Asso= ciate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon= University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.e= du



On Mon, Jun 2, 2014 at 7:23 PM, zhenjian= g zech xu <zhenjiang.xu@gmail.com> wrote:
Hi orgmoders,

I= s there any existing function to copy files in the external links to a spec= ified location when exporting .org file to html? I know org-publish has fun= ctionality to copy files with certain suffices on defined project, but my n= eed is to export single file or single subtree in the buffer.

For example, when I export the following subtree, it would b= e lovely to copy the spam.png to the path I set up.
* foo
=C2=A0 [[file:spam.png]]

If there is no function ready to do that, what is the easie= st easy to implement it? any point to the right direction is appreciated.
Thanks,
Zhenjiang

--001a1135e62491ae6f04fae4dfed--