Wie kann ich pandoc dazu bringen, meine benutzerdefinierten YAML-Felder zu erkennen?

843
Jonathan

Ich habe eine Markdown-Datei, die wie folgt beginnt:

---  title: Some Title author:  - family: Barson given: Foobius --- 

Und ich möchte, dass Pandoc diese Informationen extrahiert und ausgibt. Ich habe also eine einfache Vorlage, die so aussieht:

title: $title$ author: $author$ author given: $author.given$  author family: $author.family$ 

Doch wenn ich renne pandoc my-file.md --template=my-template.html, bekomme ich das:

title: Some Title author: true author given:  author family:  

Was ich erwartet hatte, war folgendes:

title: Some Title author: Foobius Barson author given: Foobius author family: Barson 

Was mache ich falsch mit dieser Pandoc-Vorlage?

2

1 Antwort auf die Frage

2
Jonathan

Ich habe es selbst herausgefunden. Es stellte sich heraus, dass ich nur die $author.given$s in eine forSchleife einwickeln musste :

$for(author)$ author given: $author.given$ author family: $author.family$ $endfor$