@@ -1,6 +1,35 @@
1-- | Module providing pattern matching and capturing on 'Identifier's.
1-- | Module providing pattern matching and capturing on 'Identifier's.
3−-- TODO: Documentation
3+-- A very simple pattern could be, for example:
7+-- This pattern will only match the @foo\/bar@ identifier.
9+-- To match more than one identifier, there are different captures that one can
12+-- * @*@: matches exactly one element of an identifier;
14+-- * @**@: matches one or more elements of an identifier.
18+-- * @foo\/*@ will match @foo\/bar@ and @foo\/foo@, but not @foo\/bar\/qux@ nor
21+-- * @**@ will match any non-empty identifier;
23+-- * @foo\/**@ will match @foo\/bar@ and @foo\/bar\/qux@, but not @bar\/foo@ nor
26+-- A small warning: patterns are not globs. Using @foo\/*.markdown@ will not do
27+-- what you probably intended, as it will only match the file which is literally
28+-- called @foo\/*.markdown@. Remember that these captures only work on elements
29+-- of identifiers as a whole; not on parts of these elements.
31+-- Furthermore, the 'match' function allows the user to get access to the
32+-- elements captured by the capture elements in the pattern.
5module Hakyll.Core.Identifier.Pattern
34module Hakyll.Core.Identifier.Pattern