Homepage    |    GitHub    |    API    |    FAQ

Making Joplin recognise YAML front matter

Is there a way to make Joplin understand that if the note starts with three dashes than it is YAML and it should show it say as preformatted text till the ending three dashes?

Adding extra new lines and ugly hacks the display problem, but the dashes are interpreted as break.

1 Like

Why not use a yaml code block?

```yaml
Front matter: here
```

I never thought of that and it's a great solution while in Joplin. But once exported, apps like say Hugo: The world's fastest framework for building websites gohugo.io, won't play that nice. That's why I'm looking for a way that Joplin will get

---
data: X
variable: Y
--- 

and not formatted if these are the first characters.

Sounds like you need a plugin for this.

You need to write a joplin data api plugin. . .

I also think this is an absolutely necessary feature.

Why is it necessary? Someone mentioned Hugo earlier -- there's now a plugin to export notes to SSGs including Hugo. Are there any other use cases?

Hi @roman_r_m

Yes of course there are many other use cases. In my circle of friends, Joplin is used (and could be used even more) to take notes for research purposes. More and more researchers want to get rid of word processors and compatibility problems (libreoffice/MS). There is a tendency to open a Nextcloud for a research team (or with students) to share (and encrypt) data. Working in markdown allows to keep the objective of a reproducible research and to ensure interoperability. The txt formats are ideal for this (md, org, txt, etc). But many need to manage the complexity of writing an article, report or thesis in their markdown source files. In this area, Rmarkdown for example does an excellent job for graphics, data visualization. But everything works with a YAML header...

So yes we could use Rstudio or Zettlr as an external editor but in this case, we lose the benefit of the Joplin plugins which are very useful and more and more numerous.

This is a use case anyway.

I think MarkdownIt parser used by Joplin can recognize three dashes as it's used for the delimiter, so this looks doable in a plugin.

2 Likes