From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nik Clayton Subject: Best way to process a collection of .org files as one? Date: Thu, 1 Nov 2018 12:15:32 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000024f3c10579988a4b" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIAx2-0002qA-Is for emacs-orgmode@gnu.org; Thu, 01 Nov 2018 07:15:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIAx0-000305-Qp for emacs-orgmode@gnu.org; Thu, 01 Nov 2018 07:15:48 -0400 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]:45445) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gIAwy-0002y2-UA for emacs-orgmode@gnu.org; Thu, 01 Nov 2018 07:15:46 -0400 Received: by mail-io1-xd31.google.com with SMTP id p83-v6so11892397iod.12 for ; Thu, 01 Nov 2018 04:15:44 -0700 (PDT) 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" To: emacs-orgmode --00000000000024f3c10579988a4b Content-Type: text/plain; charset="UTF-8" Hoi, What's the best way to process (ideally using the org-element API) a collection of .org files as one larger file? I'm using Org + ox-reveal to write the course material for a three month course. This is a lot of material, so keeping it in one Org file is not practical (exporting it to the slides takes longer, it's easier to have multiple buffers open and switch between them, etc). To help ensure that I'm covering the content in a sensible order I've given each heading optional TOPIC and REQUIREMENTS properties. When a new topic is introduced I add an identifier to the TOPIC property to the heading that introduces it, and if a heading requires that a topic or topics have been introduced I add the topic identifiers as a space-separated string to the REQUIREMENTS property. I have a small function that uses the org-element API to iterate over all the headings in a file and tell if if I have any headings that list a requirement without that requirement appearing in a TOPIC property earlier in the file. This works when the file is self contained. When I have topics that might be introduced in one file, and later referenced in a second file, it obviously doesn't. I thought one approach would be to have a master Org file that references all the others, so course.org that looks like: #+INCLUDE "day1.org" #+INCLUDE "day2.org" #+INCLUDE "day3.org" ... However, org-element-parse-buffer doesn't recurse in to the included files, so this doesn't work. I could write my own function to create the recursive expansion of all the content, but before I do that I thought I'd check to see if there's a better way of doing what I'm trying to achieve. Any ideas? N --00000000000024f3c10579988a4b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hoi,

What's the best way= to process (ideally using the org-element API) a collection of .org files = as one larger file?

I'm using Org + ox-reveal = to write the course material for a three month course. This is a lot of mat= erial, so keeping it in one Org file is not practical (exporting it to the = slides takes longer, it's easier to have multiple buffers open and swit= ch between them, etc).

To help ensure that I'm= covering the content in a sensible order I've given each heading optio= nal TOPIC and REQUIREMENTS properties. When a new topic is introduced I add= an identifier to the TOPIC property to the heading that introduces it, and= if a heading requires that a topic or topics have been introduced I add th= e topic identifiers as a space-separated string to the REQUIREMENTS propert= y.

I have a small function that uses the org-eleme= nt API to iterate over all the headings in a file and tell if if I have any= headings that list a requirement without that requirement appearing in a T= OPIC property earlier in the file.

This works when= the file is self contained.

When I have topics th= at might be introduced in one file, and later referenced in a second file, = it obviously doesn't.

I thought one approach w= ould be to have a master Org file that references all the others, so course.org that looks like:

#+INCLUDE "day1.org"
#+INCLUDE "day2.org"
...

However, org-element-parse-buffer doesn't recurs= e in to the included files, so this doesn't work.

I could write my own function to create the recursive ex= pansion of all the content, but before I do that I thought I'd check to= see if there's a better way of doing what I'm trying to achieve.

Any ideas?

N
--00000000000024f3c10579988a4b--