On 2014-10-21, at 18:10, Eric Abrahamsen wrote: > Marcin Borkowski <mb...@wmi.amu.edu.pl> 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