From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: Announcement: org-one-to-many Date: Tue, 21 Oct 2014 18:58:38 +0200 Message-ID: <87mw8pfjgh.fsf@wmi.amu.edu.pl> References: <87ppdlfotc.fsf@wmi.amu.edu.pl> <871tq1h08s.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xgclk-0002gp-Up for emacs-orgmode@gnu.org; Tue, 21 Oct 2014 12:58:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xgclj-00007t-17 for emacs-orgmode@gnu.org; Tue, 21 Oct 2014 12:58:48 -0400 Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:37710) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xgcli-00007G-IY for emacs-orgmode@gnu.org; Tue, 21 Oct 2014 12:58:46 -0400 Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 97B6941478 for ; Tue, 21 Oct 2014 18:58:44 +0200 (CEST) Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Rz9XKDA8xhUm for ; Tue, 21 Oct 2014 18:58:44 +0200 (CEST) Received: from localhost (unknown [IPv6:2001:808:114:6:c01c:b446:c425:e3d7]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 73D5F4146C for ; Tue, 21 Oct 2014 18:58:44 +0200 (CEST) In-reply-to: <871tq1h08s.fsf@ericabrahamsen.net> 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: emacs-orgmode@gnu.org On 2014-10-21, at 18:10, Eric Abrahamsen wrote: > Marcin Borkowski writes: > >> Hi all, >> >> a long time ago I asked here about a way to split an Org file into a >> bunch of smaller ones. One of the answers I got was that the tricky >> part is maintaining internal links in a reasonable way. >> >> It is probably overoptimistic on my side, but it seems that this problem >> is solved now. The code is not very elegant, and I will be actively >> working on it (I want to write an org-to-e-learning exporter, based on >> the HTML one, and this is a small part of that effort), but here it is >> for testing/review/bug reports/feature requests/any other kind of >> feedback. >> >> And here it is: https://github.com/mbork/org-one-to-many > > Oooh, cool. I'll look forward to reading it! Thanks, but don't expect too much, I'm still learning Elisp. I'll be thankful for your feedback! My idea to solve the problem of links is that I first mark the parts which will be exported to various files using text property :otm-filename, then walk all the internal links (in reverse order, which is important, since I first gather them in a list, so I don't want to mess the begin/end positions of the links) and change them according to that property of their destination (unless they point to the same portion, in which case they stay the same), and only then split the file (again using the text property). This might not be the most elegant thing in the world, but it seems to work. Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University