Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Rule memory as path source #753
Summary: Use the rule memory to determine the (basic) path for an item rep, to prepare for adding a
The item reps get their paths (per snapshot) in the
The rule memory calculator compiles the item with a “recording executor”, which does nothing but record filter/layout/… invocations.
The rule memory calculator will determine the (basic) path for an item rep. It will do so by finding the appropriate routing rule for that item and creating an appropriate
The item rep router is still responsible for converting this basic path (e.g.
This makes it possible to add a
compile '/*.md' do filter :kramdown snapshot :whatever, path: item.identifier.without_ext + '/index.html' end
… as opposed to this:
route '/*.md' do item.identifier.without_ext + '/index.html' end compile '/*.md' do filter :kramdown end
Having to specify a snapshot is annoying, so there will be a convenience method
compile '/*.md' do filter :kramdown write item.identifier.without_ext + '/index.html' end
This approach also helps pushing the rules further away from the core of Nanoc, and the rule memory might become a “processing instruction list”, which could become what Nanoc uses to determine how to process an item rep. With that in place, Nanoc could gain alternatives to the Rules file as a processing instruction source.