diff --git a/songbook_core/content/cwd.py b/songbook_core/content/cwd.py new file mode 100644 index 00000000..6c76d8c2 --- /dev/null +++ b/songbook_core/content/cwd.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os + +from songbook_core.content import process_content + +def parse(keyword, config, argument, contentlist): + config['songdir'] = ( + [os.path.relpath(argument)] + + [os.path.join(path, argument) for path in config['songdir']] + + config['songdir'] + ) + return process_content(contentlist, config) + +CONTENT_PLUGINS = {'cwd': parse}