diff options
authorPatrick Spek <p.spek@tyil.nl>2017-04-24 01:13:57 +0200
committerPatrick Spek <p.spek@tyil.nl>2017-04-24 01:13:57 +0200
commit4f5a70e700623da0b799d6f861bd7fb1a6dbbc85 (patch)
parent60aff52595020f378cd0d1a4d9d75894e083b9e0 (diff)
Extend the readme
1 files changed, 57 insertions, 0 deletions
diff --git a/README.md b/README.md
index f74be3e..5297220 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,63 @@
# Config
A perl 6 library for reading and writing configuration files.
+## Installation
+This module can be installed using `zef`:
+zef install Config
+Depending on the type of configuration file you want to work on, you will need a
+`Config::Parser::` module as well. If you just want an easy-to-use configuration
+object without reading/writing a file, no parser is needed.
+## Usage
+Include the `Config` module in your script, instantiate it and use it as you
+use Config;
+my $config = Config.new();
+# loading a simple configuration hash
+ keyOne => "value",
+ keyTwo => {
+ NestedKey => "other value"
+ }
+# loading a configuration files
+# retrieving a simple key
+# retrieving a nested key
+### Available parsers
+Because there's so many ways to structure your configuration files, the parsers
+for these are their own modules. This allows for easy implementing new parsers,
+or providing a custom parser for your project's configuration file.
+The parser will be loaded during runtime, but you have to make sure it is
+installed yourself.
+The following parsers are available:
+- [`Config::Parser::yaml`](https://github.com/scriptkitties/p6-Config-Parser-yaml)
+### Writing your own parser
+If you want to make your own parser, simply make a new class in the
+`Config::Parser` namespace. This class should extend the `Config::Parser` class,
+and implement the `read` and `write` methods. The `read` method *must* return a
+`Hash`. The `write` method *must* return a `Bool`, `True` when writing was
+successful, `False` if not.
## License
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software