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

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

Open
sebastianbock17 opened this issue Dec 13, 2021 · 3 comments
Open

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

sebastianbock17 opened this issue Dec 13, 2021 · 3 comments

Comments

@sebastianbock17
Copy link

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

BasilPH commented Dec 25, 2021

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

BasilPH commented Apr 17, 2022

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

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants