dendronhq / dendron

The personal knowledge management (PKM) tool that grows as you do!
https://wiki.dendron.so
Apache License 2.0
6.77k stars 260 forks source link

Computed frontmatter entries #462

Open ghost opened 3 years ago

ghost commented 3 years ago

Recent adopter of Dendron, love it so far!

I'm coming from Notion and for my work-log I've set up a function that calculates how much time has elapsed since I joined my current job.

It seems like we already have some date values for created and updated in the frontmatter.

How would I add a computed frontmatter value?

I'm picturing it as two entries in the frontmatter:

I've added custom templates to schema where I added to the frontmatter. I've just not seen examples of computed frontmatter entries.

kevinslin commented 3 years ago

Hey, welcome to Dendron!

Computed frontmatter isn't something we currently support though something I would love to add. We want to start introducing some basic operators in the frontmatter but we haven't decided on syntax yet. If you have ideas on this front, feel free to share here or in our discord :)

ghost commented 3 years ago

I could look into it too. Is there a particular module/file I should be looking at? I'll dig in anyway.

Might be handy to add a 'Good First Issue' label for those that want to contribute. 🙌

kevinslin commented 3 years ago

That would be great. A little more involved than a first issue but all the more power to you:😅

for the timestamps, here's the code for it today

for computed frontmatter, there are two approaches:

let me know if you have thoughts on this.

if you're interested in actual first issues, here are some that are good to get started

ghost commented 3 years ago

Perfect, I'll check this out. Thank you for the steer 💪

kpathakota commented 3 years ago

@alanionita - have you taken a look at this before? If you've got a bit, we'd love for you to put your learnings into an RFC: https://wiki.dendron.so/notes/f143ca38-dcc6-4cd3-b84b-997aec1160ef.html. If not, no worries and someone else can pick this up. I think this is a an excellent power feature as well.