Skip to content

Multiple preprocess directives #64

@bbukh

Description

@bbukh

While it is possible to have several route and compile commands, only one preprocess command is permitted. That has become a problem for my project which has two distinct parts. Each has a separate section in the Rules file with its own set of route and compile commands. However, I cannot achieve a clean separation of the preprocessing steps. The best I have managed is

preprocess_A = proc { |obj|
  obj.instance_exec() {
     # code for preprocessing A-related items 
  }
}

preprocess_B = proc { |obj|
  obj.instance_exec() {
     # code for preprocessing B-related items 
  }
}

preprocess do
  preprocess_A.call(self)
  preprocess_B.call(self)
end

Possible fixes (in order of descending desirability):

  1. Add support for multiple preprocess commands.
  2. Add documentation to https://nanoc.app/doc/troubleshooting/ or to https://nanoc.app/doc/rules/#preprocessing explaining how to achieve this functionality (kludge above or something better).
  3. Fix the typo in the warning message in compiler_dsl.rb: it should say "another postprocess block overrides the previously SUPPLIED one".

Finally, let me express great thanks for the wonderful tool! I have used nanoc for years, and was silent about it only because it has been doing everything I needed so well that I did not need to say anything :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions