-
Notifications
You must be signed in to change notification settings - Fork 82
Export item metadata in YAML frontmatter #27
Comments
Hi @Gnossos, I don't use Zettlr so I'm afraid I won't have time to develop/test for it. Feel free to open a PR for it though! The only constraint for accepting PRs is that they remain editor-agnostic, if you add any editor-specific features they should be optional. That being said, I believe the upcoming release with a custom format should allow you to do that (or most of it). I'd recommend waiting until v0.1.0 before starting on a PR. |
Sorry, I learned about Mdnotes on the Zettlr forum, and the individual who posted about it seemed to be its author. It was presumptuous of me to assume you used Zettlr. But with this aside, the option of using pandoc YAML syntax instead of the double brackets would still be useful. Since bibliographic information in a markdown document is frequently rendered with pandoc, formatting the metadata this way would save an extra step. I believe Zettlr uses a subset of the pandoc YAML, which probably just means the Zettlr documentation only covers some of the allowable fields. The pandoc User's Guide describes them on p. 40ff. |
Not to worry, that's the nice thing about markdown, the editor shouldn't matter much! I don't use pandoc very often with markdown files (I tend to use LaTeX for final form writing), but whenever I need to use pandoc with bibliography, I tend to do it through the CLI, e.g. |
Hi @Gnossos, I've added an My suspicion is that the templates, custom format and wildcards could get you 90% there, but at the expense of being able to use them somewhere else. Let me know if/how that works for you. |
I could do some testing/developing, as I stumbled upon the plugin myself and this fits pretty well into workflows with regard to Zettlr. Plus, I'm also a huge fan of keeping everything editor-agnostic and using options for those stuff. |
Hey @nathanlesage, thanks for offering! I'm preparing the release right now, let me know if you have any questions about it or if there's anything I can do to help! |
Hi, I am just doing this and it seems to work very well. I am doing it to share my zotero items to a hugo blog but I think this is extremely versatile. A person like me who knows jack about s..t can easily export the zotero items into practically any text-based file format just by creating a dummy file. I tried using The way I did it was to go through every hidden preference in about:config that I would be interested and also add those which are missing. In most cases remove everything except the basic value. So for example if you want the below to be your ---
title: "{{title}}"
tags:
- {{tags}}
slug: "{{citekey}}"
lang: "{{language}}"
date: {{accessDate}}
draft: true
---
here is what you need to change/add in the
first I just deleted this. find
You could also use create preference {"content":"{{field_contents}}", "link_style": "none", "list_separator": ", "}
change {"content":"{{field_contents}}", "field_contents": "{{content}}", "link_style": "no-links", "list_separator": "\n - ", "remove_spaces": "true"} this will make the tags be a dashed list like this tags:
- apples
- hotdogs
- friday
make sure the change {"content":"{{field_contents}}", "field_contents": "{{content}}", "link_style": "no-links"}
create preference {"content":"{{field_contents}}", "link_style": "itemType", "list_separator": ", "}
(this would probably be inappropriate in a lot of cases so you'd neede another way to set the date) create preference {"content":"{{field_contents}}", "link_style": "itemType", "list_separator": ", "} Questions and unresolved So the above works the way I expect on the files I have tested it on. I kept notes of all the things I changed and also made a template that have a lot of the values so you can test the results. I would be happy to share this if wanted, but it was pretty tedious to enter them all by hand.
Even exactly as-is this is a massive improvement over my workflow as it existed 12 hours ago so THANK YOU. <3 edit: on further experimentation I found changes needed and I adjusted the above:
|
Thanks for the very useful tool. These may be good ideas for enhancements. Since they're related, I'm putting them in one issue.
Instead of exporting each field in brackets, e.g. [[Title]], give the option of using YAML format, e.g., title: and enclosing the fields in a YAML header (---/...).
Export the fields as it's done now, but also enter information in corresponding YAML fields defined by Zettlr or pandoc. E.g., still export [[Title]], but also initialize a YAML header with title:
Modify the exported MD file so it starts with a generic YAML header (with or without appropriate fields initialized, as in 2); this would eliminate one step in initializing a literature zettel.
The text was updated successfully, but these errors were encountered: