all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Best way to process a collection of .org files as one?
@ 2018-11-01 11:15 Nik Clayton
  2018-11-01 13:34 ` Matt Price
  0 siblings, 1 reply; 2+ messages in thread
From: Nik Clayton @ 2018-11-01 11:15 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Best way to process a collection of .org files as one?
  2018-11-01 11:15 Best way to process a collection of .org files as one? Nik Clayton
@ 2018-11-01 13:34 ` Matt Price
  0 siblings, 0 replies; 2+ messages in thread
From: Matt Price @ 2018-11-01 13:34 UTC (permalink / raw)
  To: nik; +Cc: Org Mode

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

This isn't really an answer to your question, but I keep all my lectures
for each course in a single file, then export subtrees when I need them.
For me, this works well.   I have recently started using a -dwim export
scope based on Kaushal's org-hugo-export-dwim functions.  But... I seem to
have lost the code, drat!  Anyway, I will write it up again sometime
soon I hope. It's a conveinence function that looks for a an EXPORT_FILE
property in the parents of the current subtree and chooses that as the
export scope. I had written -- I think i a lost scratch buffer! -- versions
for both reveal and my derived "huveal" backend which sends my slides to a
website.

On Thu, Nov 1, 2018 at 7:16 AM Nik Clayton <nik@ngo.org.uk> wrote:

> 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: 7091 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-01 13:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-01 11:15 Best way to process a collection of .org files as one? Nik Clayton
2018-11-01 13:34 ` Matt Price

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.