nobiot / org-transclusion

Emacs package to enable transclusion with Org Mode
https://nobiot.github.io/org-transclusion/
GNU General Public License v3.0
943 stars 48 forks source link

Transclude only the header #150

Open bitozoid opened 2 years ago

bitozoid commented 2 years ago

I have tried to transclude just a header in an org file. :lines -1 does the work, but then :level does not work.

This may seem the opposite that transclude is thougth for, but I can find an use case.

Let's say I have an org file with lots of todos and I would like to make a planning for them, but I do not want to change that file. I could open another buffer, transclude all the todo headers, and then rearrange them in a way similar to a gantt project, but just using org hierarchy. I could also add coments about their relationship in planning.

nobiot commented 2 years ago

You might like to try :exclude-elements "paragraph". See the example below.

Two transclusions with the same source headline (with an ID). One excludes paragraphs, and the other includes them. With the :exclude-elements "paragraph", you can transclude just headings of a subtree like this.

2022-09-05T172350

2022-09-05T172416

bitozoid commented 2 years ago

That sounds interesting.

Would I need to exclude a full list of elements to ensure that only the header gets transcluded? '‘center-block’, ‘drawer’, ‘dynamic-block’, ‘latex-environment’, ‘paragraph’, ‘plain-list’, ‘quote-block’, ‘special-block’, ‘table’, ‘verse-block’, 'comment-block’, ‘export-block’, ‘example-block’, ‘fixed-width’, ‘keyword’, ‘src-block’, ‘property-drawer', ...

Would excluding 'headline' avoid subheadings?

nobiot commented 2 years ago

Just very quickly… for the first question, I believe yes. ilI suggest to try it yourself. I don’t know what your org usage is like. You could also try “section” I think.

for the second question, I think so. I believe I have written a special section in the user manual. You can also try how the system behaves.

I don’t remember all the possible behaviors… my usage is very simple and infrequent.