+-------------------------------------------------------------------------------
+-- Public Interface
+-------------------------------------------------------------------------------
+
+Configuration.configuration = {}
+extend(Configuration.configuration, defaults)
+
+--- Extends configuration with another configuration
+function Configuration.configure(configuration)
+ configuration = configuration or {}
+ extend(Configuration.configuration, configuration)
+end
+
+--- Gets expanded paths relative to nota_home
+-- @param path string the relative path to expand
+function Configuration.path_for(path)
+ if not path then
+ return vim.fn.expand(Configuration.configuration.nota_home)
+ end
+ return Util.join(vim.fn.expand(Configuration.configuration.nota_home), path)
+end
+
+--- Loads a template by template name
+function Configuration.load_template(type)
+ local template_path = Configuration.path_for(Configuration.configuration.templates[type])
+
+ local template_file = io.open(template_path, 'r')
+ if not template_file then
+ return ''
+ end
+ local content = template_file:read('*a')
+ template_file:close()
+ return content