MultiMarkdown files can have metadata. MultiMarkdown supports a subset of YAML metadata, and does not seem to complain about other YAML. YAML metadata in Markdown documents is used by prominent Markdown-using applications like the Pandoc converter and static site generators like Hugo and Jekyll. GitHub Pages files use it. In other words, there are lots of reasons one might write Markdown with metadata.
For example, one might use the following sort of metadata block (with YAML’s “
---” delimiters being optional for MultiMarkdown):
--- title: "Document 2" date: 2019-11-18T09:58:00-05:00 draft: false tags: research, notebook --- # Main Section body material
Happily, DEVONthink’s MultiMarkdown processing respects such metadata, by hiding it in previews, so it doesn’t clutter up the screen. My question is whether there is a way to expose some or all of these metadata fields to DEVONthink, or for DEVONthink to see it.
An application of this metadata visibility would be the following sort of automation:
- A Markdown file is imported to DEVONthink.
- Instead of processing the first line as the title (which gives it the title “
---”), DEVONthink recognizes that the
titlevalue is “Document 2” and assigns that as the title.
- Perhaps other fields are processed, or visible for scripting, like
I imagine it might be possible to script this by calling a separate YAML processor like yq from within a shell script in a DT smart rule. I’m wondering whether there might be any more direct way to do it within DEVONthink.