With
stream = open(afile, 'r')
self.meta = yaml.load(stream)
you can easyly read YAML file in python, but it has not got ---
at the end I reach error (same with ...
):
yaml.composer.ComposerError: expected a single document in the stream
in "El-punt-de-llibre.md", line 2, column 1
but found another document
in "El-punt-de-llibre.md", line 6, column 1
But YAML specs allow that:
YAML uses three dashes (“---”) to separate directives from document content. This also serves to signal the start of a document if no directives are present. Three dots ( “...”) indicate the end of a document without starting a new one, for use in communication channels.
So, how do you read this
---
title: "El punt de llibre"
abstract: "Estimar a quina pàgina està el punt de llibre"
keywords: ["when", "activitat", "3/3", "grup", "estimació", "aproximació", "funció lineal - proporcionalitat", "ca"]
comments: true
...
in python?