Generated documents

I’ve been thinking, particularly for sharing information with others, it may be useful to be able to create ‘compilation documents’ which combine multiple notes into a single file.

Use case example

I’ve recently started adding interesting snippets of information regarding computing hardware to my network. A tech-y friend of mine may express some interest. It would be very nice if I were able to generate a single combined file I could export to a PDF and send them.

Proposed functionality

Take some minimal example network of notes. A query is performed on a particular vertex.
A DFS is then performed alphabetically (just some order) according to the query, and a resultant combined file generated. This could be placed in a sub directory, or a tmp file. It would be opened immediately after creation.

Examples

Let’s have this as the sample graph, with the vertices/letters being notes, and the colours representing tags.

Query One

All blue notes

Result

* A
** B
** C
*** G
** D
** F

Query Two

Blue, to depth 1

Result

* A
** B
** C
** D
** F

Query Three

All blue and green notes

Result

* A
** B
*** H
**** I
** C
*** G
** D
** E
** F

Query Four

Let’s make this extra-fancy and have two query ‘source’ notes — A and J.

Brown, and connected green up to depth 1

Result

* A
** E
* J
** K
** L
** I

Final comments

Currently, I just have this idea. I certainly don’t have the time to implement it in the near future.

To prompt conversation though, I thought I may as well put the idea together and share it.
If someone else is interested enough to try to whip up a prototype, that would be lovely :slight_smile:

1 Like

I thought about that at one point, but then thought it seems like needless complexity.

We can, after all, manually construct that sort of structure; either with “structure notes,” or with org #+INCLUDE. And transclusion, if done right, could enhance that.

But I’m always the one to argue in favor of simplicity :wink:

If we did have a feature like that, could also be used to auto-construct structure notes; where instead of putting in the content, put in the links, as a kind of starting point. That may or may not be a good idea though.

It sounds like simply having an easy way to query could achieve this then, using #+INCLUDE: – generate any list of notes you want, put them in some arbitrary order, compile a list of #+INCLUDE:. A user could fine tune the included content using standard org options, such as restricting to specific headlines.

Oh, I’m not suggesting that we do anything complex, I just don’t want to manually enumerate through all the files and #+INCLUDE each one.

Off the top of the head, all that’s required is

  • use a filter
  • identifying connected nodes which match the filter
  • enumerating them
  • create a new buffer with the relevant #+INCLUDEs and save
1 Like

One particular aspect that needs to be kept in mind is cyclic dependency resolution.
If in your your very first figure, G and D shared an edge, then you’d have a pickle to be resolved on your hands :wink: