lib/nanoc3/base/compiler_dsl.rb in nanoc3-3.1.0a2 vs lib/nanoc3/base/compiler_dsl.rb in nanoc3-3.1.0a3
- old
+ new
@@ -31,26 +31,28 @@
#
# An item rep will be compiled by calling the given block and passing the
# rep as a block argument.
#
# @param [String] identifier A pattern matching identifiers of items that
- # should be compiled using this rule
+ # should be compiled using this rule
#
# @option params [Symbol] :rep (:default) The name of the representation
- # that should be compiled using this rule
+ # that should be compiled using this rule
#
# @yield The block that will be executed when an item matching this
- # compilation rule needs to be compiled
+ # compilation rule needs to be compiled
#
# @return [void]
#
# @example Compiling the default rep of the `/foo/` item
+ #
# compile '/foo/' do
# rep.filter :erb
# end
#
# @example Compiling the `:raw` rep of the `/bar/` item
+ #
# compile '/bar/', :rep => :raw do
# # do nothing
# end
def compile(identifier, params={}, &block)
# Require block
@@ -73,26 +75,28 @@
#
# The path of an item rep will be determined by calling the given block
# and passing the rep as a block argument.
#
# @param [String] identifier A pattern matching identifiers of items that
- # should be routed using this rule
+ # should be routed using this rule
#
# @option params [Symbol] :rep (:default) The name of the representation
- # that should be routed using this rule
+ # that should be routed using this rule
#
# @yield The block that will be executed when an item matching this
- # compilation rule needs to be routed
+ # compilation rule needs to be routed
#
# @return [void]
#
# @example Routing the default rep of the `/foo/` item
+ #
# route '/foo/' do
# item.identifier + 'index.html'
# end
#
# @example Routing the `:raw` rep of the `/bar/` item
+ #
# route '/bar/', :rep => :raw do
# '/raw' + item.identifier + 'index.txt'
# end
def route(identifier, params={}, &block)
# Require block
@@ -111,23 +115,25 @@
# regular expression. The layouts matching the identifier will be filtered
# using the filter specified in the second argument. The params hash
# contains filter arguments that will be passed to the filter.
#
# @param [String] identifier A pattern matching identifiers of layouts
- # that should be filtered using this rule
+ # that should be filtered using this rule
#
# @param [Symbol] filter_name The name of the filter that should be run
- # when processing the layout
+ # when processing the layout
#
# @param [Hash] params Extra filter arguments that should be passed to the
- # filter when processing the layout (see {Nanoc3::Filter#run})
+ # filter when processing the layout (see {Nanoc3::Filter#run})
#
# @return [void]
#
# @example Specifying the filter to use for a layout
+ #
# layout '/default/', :erb
#
# @example Using custom filter arguments for a layout
+ #
# layout '/custom/', :haml, :format => :html5
def layout(identifier, filter_name, params={})
@site.compiler.layout_filter_mapping[identifier_to_regex(identifier)] = [ filter_name, params ]
end