EFLS/zetteldeft

Question: implement a new note template?

Dermody opened this issue ยท 8 comments

I'm really excited about migrating my existing org-mode zk to a zetteldeft-driven environment. Given I already live in org-mode, I'd really like to use org tags within zettels to help tie thoughts together. The idea I'm currently entertaining is customizing the new zettel template (default being solely #+TITLE:) to include two org headers, the first solely to hold org tags (including a default :zettel:). If I'm right , zetteldeft-title-prefix and zetteldeft-title-suffix are only used to modify titles on the fly, rather than all newly created files.
Question: how might I modify the zetteldeft new file template?

EFLS commented

There is not really any template built in. You are correct that only title prefix and suffix are used.

Not sure what the best solution is for you. You could perhaps use packages such as yankpad or yasnippet to create templates that you then expand?

Question: how might I modify the zetteldeft new file template?

Actually I am still on vanilla deft, so I am not positive what I am about to say is fully applicable.

Having said that, what I did was to leverage deft-open-file-hook to call a custom function to populate the new node/file. Actually, what mine does is check if it is already an Org heading or not (simple test for an asterisk at position 1 in buffer) and if not then initialize the node. And if it has already been initialized, then update some properties about VISIT_LAST and VISIT_COUNT which you may or may not want. I am not sure how comfortable you are in hacking Elisp, but I would be happy to share what I have as a starting point should you be interested.

It seems we are on the same page as regards sticking with an Org heading as node title, instead of "#+TITLE: " type metadata. You may want to check out my (admittedly, extended) discussion of some related thoughts/issues in #76.

EFLS commented

Actually I am still on vanilla deft

Time to get started then! Clone the zd-tutorial repository and begin exploring ๐Ÿ˜‰

On a related note: Zetteldeft has a customizeable zetteldeft-title-prefix, which could be a single asterisk.

I usually move very slow and methodical, like turtle. ๐Ÿข

๐Ÿ˜„

I feel now familiar enough with deft itself to add more complexity on top, so next I start playing with zetteldeft.

I really enjoyed all our conversations so far EFLS, and look forward to coming back with more thoughts after getting started with zetteldeft (and/or zd-tutorial) a bit...

Until then cheers! ๐Ÿป

EFLS commented

To get back to this discussion: currently, I have no plans to implement a template system. For my use case, the zetteldeft-title-prefix and -suffix are sufficient.

That said, I'm open to suggestions about how to better accommodate different workflows, so feel free to share thoughts, ideas, and - importantly - code suggestions ๐Ÿ˜„.

Hi EFLS. Thank you for Zetteldeft, it is great. I would like to ask is it would be possible to include the ID as a part of the string passed to zetteldeft-title-prefix, I am not very fluent in Lisp.

EFLS commented

I'm not sure what you are after, @southern-tools. Could you explain what it is you are trying to do? Feel free to open a new issue.

In any case: zetteldeft-title-prefix is a customizable variable. It's meant to be static. At least that's how its designed, you might be able to whip up some elisp and make some changes, depending on your goals

I am just trying to have the full filename in the title. Like: "Note ID: 20212109 Some Title.md". So far, I am able to do zetteldeft-title-prefix "Note ID: " and zetteldeft-title-suffix ".md" which gives me only "Note ID: Some Title.md", but I am missing the timestamp.