diff --git a/examples/example-all.yaml.sb b/examples/example-all.yaml.sb new file mode 100644 index 00000000..3a167565 --- /dev/null +++ b/examples/example-all.yaml.sb @@ -0,0 +1,17 @@ +bookoptions: + - "diagram" + - "repeatchords" + - "lilypond" + - "pictures" +booktype: "chorded" +datadir: "." +template: "patacrep.tex" +lang: "fr" +encoding: "utf8" +authwords: + sep: + - "and" + - "et" +content: + - + - "sorted" \ No newline at end of file diff --git a/patacrep/songbook/__main__.py b/patacrep/songbook/__main__.py index cc56311b..b972b04c 100644 --- a/patacrep/songbook/__main__.py +++ b/patacrep/songbook/__main__.py @@ -1,7 +1,7 @@ """Command line tool to compile songbooks using the songbook library.""" import argparse -import json +import yaml import locale import logging import os.path @@ -135,13 +135,13 @@ def main(): try: with patacrep.encoding.open_read(songbook_path) as songbook_file: - songbook = json.load(songbook_file) + songbook = yaml.load(songbook_file) if 'encoding' in songbook: with patacrep.encoding.open_read( songbook_path, encoding=songbook['encoding'] ) as songbook_file: - songbook = json.load(songbook_file) + songbook = yaml.load(songbook_file) except Exception as error: # pylint: disable=broad-except LOGGER.error(error) LOGGER.error("Error while loading file '{}'.".format(songbook_path))