Timeline for Use contents of a heading in Yasnippet
Current License: CC BY-SA 4.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 20, 2024 at 20:46 | answer | added | NickD | timeline score: 1 | |
| Jul 20, 2024 at 2:29 | comment | added | NickD | So you need to pass the custom ID to the snippet and have the snippet search for the headline based on the passed-in custom ID, retrieve the text and insert it - correct? As an editorial comment, unless you have a special need to do that repeatedly, I would cut-and-paste manually, perhaps with the aid of a function that does the search and adds the text to the kill ring; you might be able to write a snippet that uses that function, but templates and snippets should (IMO of course) only be used for simple purposes, like inserting repetitive text. Complicated logic should be avoided in general. | |
| Jul 20, 2024 at 1:47 | history | edited | Deshmukh | CC BY-SA 4.0 | added 121 characters in body |
| Jul 20, 2024 at 1:45 | comment | added | Deshmukh | @NickD Thanks. I have updated the question. | |
| Jul 19, 2024 at 22:50 | review | Close votes | |||
| Jul 20, 2024 at 2:30 | |||||
| Jul 19, 2024 at 22:34 | comment | added | NickD | Presumably, the snippet is going to be expanded somewhere other than in that headline: maybe a different point in the same file, maybe a different buffer altogether. How are you going to tell the snippet which headline's contents to harvest? | |
| Jul 19, 2024 at 17:02 | history | asked | Deshmukh | CC BY-SA 4.0 |