Document the class mappings features
Signed-off-by: martin f. krafft <madduck@madduck.net>
diff --git a/doc/source/operations.rst b/doc/source/operations.rst
index 671b8b0..0bbf599 100644
--- a/doc/source/operations.rst
+++ b/doc/source/operations.rst
@@ -75,6 +75,23 @@
node into what has been accumulated during the processing of the classes, and
returns the final result.
+Wildcard/Regexp mappings
+------------------------
+Using the :doc:`configuration file <configfile>`, it is also possible to
+provide a list mappings between node names and classes. For instance::
+
+ class_mappings:
+ - \* default
+ - /^www\d+/ webserver
+ - \*.ch hosted@switzerland another_class_to_show_that_it_can_take_lists
+
+This will assign the ``default`` class to all nodes (make sure to escape
+a leading asterisk (\*) to keep YAML happy), ``webserver`` to all nodes named
+``www1`` or ``www999``, and ``hosted-in-switzerland`` to all nodes whose names
+end with ``.ch`` (again, note the escaped leading asterisk). Multiple classes
+can be assigned to each mapping by providing a space-separated list (class
+names cannot contain spaces anyway).
+
Parameter interpolation
------------------------
Parameters may reference each other, including deep references, e.g.::
diff --git a/doc/source/todo.rst b/doc/source/todo.rst
index 5aa12c7..446dd59 100644
--- a/doc/source/todo.rst
+++ b/doc/source/todo.rst
@@ -29,22 +29,15 @@
people understand what's going on, where data are being changed/merged, and to
help solve problems.
-Default classes
----------------
-Through the configuration file, it should be possible to define a set of
-default classes that are applied to all nodes (before anything else).
+Mapping interpolation
+---------------------
+Given class mappings, it should be possible to use references in the classes,
+e.g.:
-This would be covered by the next point:
+ /\.(\S+)$/ → in-domain-\1
-Wildcards, regexp→class mapping
--------------------------------
-I envision the ability to define mappings between regexps and classes, e.g.::
-
- /^www\d+/ → webservers
- /\.ch\./ → hosted@switzerland
-
-These classes would be applied before a YAML file matching the actual hostname
-would be read and merged.
+such that a host like ``example.org`` would get the class ``in-domain-org``
+assigned to it.
Data from CMS for interpolation
-------------------------------