emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nik Clayton <nik@ngo.org.uk>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Best way to process a collection of .org files as one?
Date: Thu, 1 Nov 2018 12:15:32 +0100	[thread overview]
Message-ID: <CAKJTzL59uunf70v8j37UnwX=eKsV0eTkaMRmK+-msRHjw8mwtQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1684 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 6020 bytes --]

             reply	other threads:[~2018-11-01 11:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01 11:15 Nik Clayton [this message]
2018-11-01 13:34 ` Best way to process a collection of .org files as one? Matt Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKJTzL59uunf70v8j37UnwX=eKsV0eTkaMRmK+-msRHjw8mwtQ@mail.gmail.com' \
    --to=nik@ngo.org.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).