BasilPH / vizel

Zettelkasten visualization and stats🤩🗒
GNU General Public License v3.0
59 stars 5 forks source link

How to load title from YAML Header for the generated PDF? #36

Open sebastianbock17 opened 2 years ago

sebastianbock17 commented 2 years ago

Dear Mr. Basil,

How would it be possible to load the title of Zettels from the Yaml header?

Suppose, all notes start with a $filename like so (%Y%m%d%H%M).rmd, e.g. "202112132135.rmd". Each of these include a standard YAML header like so:

---
title: The Title for this Zettel.
date:
tags:
citation:
---

Suppose, I would like to display the title for this Zettel in the Graph. Or, even better, just concatenate the title to the ID (%Y%m%d%H%M).rmd

Do you think, there would be any possibility for achieving this with vizel?

Also, I am using the .rmd extension. How would it be possible to specify the .rmd filetype instead of .txt or .md?

Kind regards :)

BasilPH commented 2 years ago

Hi @yetipowers.

How would it be possible to load the title of Zettels from the Yaml header?

So far, I only read the files once to extract links to other files. All of this happens in _extract_valid_references here. You can copy that function and analyse the header, instead of looking for the references to other Zettel.

It's not super clean though, as we would read the files twice. In the context of #35 I'm working on function that loads the file content into the graph, so that we can do arbitrary things with the content. If you're willing to wait a bit for this change, it might make things easier for you.

Also, I am using the .rmd extension. How would it be possible to specify the .rmd filetype instead of .txt or .md?

You would need to extend this line here to read "*[.md|.txt|.rmd]".

BasilPH commented 2 years ago

@yetipowers I've merged #35. You can see in the code how I access the file content, this could help you with extracting the title from the YAML header.

tokisuno commented 4 months ago

necroposting but this would be a really good feature to have when visualizing your zettelkasten.

image

(ignore how i am linking things, i'm new to this xd)