@@ -81,7 +81,9 @@ compile pattern compiler = RulesM $ do
8181-- | Add a compilation rule
8282--
8383-- This sets a compiler for the given identifier. No resource is needed, since
84−-- we are creating the item from scratch.
84+-- we are creating the item from scratch. This is useful if you want to create a
85+-- page on your site that just takes content from other items -- but has no
86+-- actual content itself.
8587--
8688create :: (Binary a, Typeable a, Writable a)
8789 => Identifier -> Compiler () a -> Rules
@@ -98,6 +100,23 @@ route pattern route' = tellRoute $ ifMatch pattern route'
98100-- Metacompilers are a special class of compilers: they are compilers which
99101-- produce other compilers.
100102--
103+-- This is needed when the list of compilers depends on something we cannot know
104+-- before actually running other compilers. The most typical example is if we
105+-- have a blogpost using tags.
106+--
107+-- Every post has a collection of tags. For example,
108+--
109+-- > post1: code, haskell
110+-- > post2: code, random
111+--
112+-- Now, we want to create a list of posts for every tag. We cannot write this
113+-- down in our 'Rules' DSL directly, since we don't know what tags the different
114+-- posts will have -- we depend on information that will only be available when
115+-- we are actually compiling the pages.
116+--
117+-- The solution is simple, using 'metaCompile', we can add a compiler that will
118+-- parse the pages and produce the compilers needed for the different tag pages.
119+--
101120-- And indeed, we can see that the first argument to 'metaCompile' is a
102121-- 'Compiler' which produces a list of ('Identifier', 'Compiler') pairs. The
103122-- idea is simple: 'metaCompile' produces a list of compilers, and the