zettel icon indicating copy to clipboard operation
zettel copied to clipboard

zettel build fail with error but doesn't show what yaml is invalid

Open gleb108 opened this issue 5 years ago • 5 comments

test$ zettel --verbose build DEBU[2020-09-21T11:43:14+03:00] verbose logging enabled
INFO[2020-09-21T11:43:14+03:00] Starting zettel...
2020/09/21 11:43:14 reading config: zettel.toml 2020/09/21 11:43:14 error while yaml unmarshal: yaml: line 3: mapping values are not allowed in this context ERRO[2020-09-21T11:43:14+03:00] OOPS: yaml: line 3: mapping values are not allowed in this context

I'd like to know what exactly yaml file cause this error but zettel doesn't show this information.

gleb108 avatar Sep 21 '20 08:09 gleb108

Can you show your zettel.toml?

mr-karan avatar Sep 21 '20 10:09 mr-karan

Sure. zettel.toml was created with zettel init command test$ cat zettel.toml description = "Hello World. This is my zettel notebook" site_name = "My Zettel"

gleb108 avatar Sep 21 '20 10:09 gleb108

I think this might be because there is invalid yaml in the frontmatter in one of your posts. Can you just post an example of any of your .md files? @gleb108

iamd3vil avatar Sep 21 '20 11:09 iamd3vil

I understand that yaml can be wrong. My point is: zettel should inform me what yaml file is invalid? It should show the filename and maybe the line, not just line number.

My yaml was created by vim+vim-zettel plugin and looks like:

`

title: sometitle date: 2020-09-16 16:53 tags: tag1:tag2:tag-three:

= Sometitle =

bla-bla-bla

Backlink: link

`

gleb108 avatar Sep 21 '20 11:09 gleb108

The tags in the front matter should be a array of strings like ["tag1", "tag2"]. I got your point about showing the error though.

iamd3vil avatar Sep 22 '20 03:09 iamd3vil