Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: implement a new note template? #77

Open
Dermody opened this issue Aug 11, 2020 · 8 comments
Open

Question: implement a new note template? #77

Dermody opened this issue Aug 11, 2020 · 8 comments
Labels
discussion Discuss practices & share information enhancement New feature or request

Comments

@Dermody
Copy link

Dermody commented Aug 11, 2020

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
Copy link
Owner

EFLS commented Aug 11, 2020

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?

@TRSx80
Copy link

TRSx80 commented Aug 13, 2020

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
Copy link
Owner

EFLS commented Aug 13, 2020

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.

@TRSx80
Copy link

TRSx80 commented Aug 13, 2020

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 EFLS added discussion Discuss practices & share information enhancement New feature or request labels Sep 20, 2020
@EFLS EFLS changed the title Question: customize new note template? Question: implement a new note template? Sep 20, 2020
@EFLS
Copy link
Owner

EFLS commented Sep 20, 2020

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 😄.

@southern-tools
Copy link

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
Copy link
Owner

EFLS commented Sep 26, 2021

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

@southern-tools
Copy link

southern-tools commented Sep 26, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discuss practices & share information enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants