Kungsgeten / yankpad

Paste snippets from an org-mode file
MIT License
216 stars 18 forks source link

Can I also add hierarchies of topics? #62

Closed michaelsjackson closed 4 years ago

michaelsjackson commented 4 years ago

Example:

* add :a:
** this
*** entire
**** hierarchy
when using shortcut "a".

I tried, it adds here only first level, not the deeper levels, any way of achieving this? Thanks in advance.

Kungsgeten commented 4 years ago

If I understand the question you should check out the first paragraph after the ordered list under "Usage" in the README. It specifies how to have stars at the beginning of lines in a snippet.

michaelsjackson commented 4 years ago

No, this does not explain it, or I did not understand, I am already a long time yankpad user, thanks for developing and sharing it, now the first time I wanted to add multiple hierarchies at once and it seems this is not possible.

I solved the situation simply by replacing my star based hierarching with headlines underlined with ========, somehow it is enough to show the structure, better than nothing.

I know in my example above the keyword or tag :a: should be on second level, first level is for the category, it should only be one quick example, but ok, not written correctly above. Concept is just having multi-level sub hierarchies below, will those be added as well. Thanks.

Kungsgeten commented 4 years ago

It might be the case that I don't understand what you want to do.

* add :a:
\* this
\** entire
\*** hierarchy
when using shortcut "a".

Doesn't this work?

michaelsjackson commented 4 years ago

Thanks, yes, this works, but where you have this information from? The first paragraph you mentioned did not explain this? Anyway the trick is then using a backslash in the templates, it works nicely then! Thanks a lot! Now I can build as complicated templates as I want. :) Can be closed.

Kungsgeten commented 4 years ago

This is the paragraph in the README I tried to refer to:

Since a at the beginning of a line would specify a new heading, lines can not begin with . However, you can write \* at the beginning of a line, which will be replaced by a * when expanding the snippet. If you use this in order to yank snippets into an org-mode buffer, the new headings will be automatically indented – depending on the current level – by default. This can be changed by setting the variable yankpad-respect-current-org-level to nil, or by using special tags.