nanoc / features

Collection of feature requests
2 stars 1 forks source link

Filters with multiple outputs #17

Open denisdefreyne opened 7 years ago

denisdefreyne commented 7 years ago

A filter can currently only generate a single piece of output. For some filters, being able to output multiple files is useful (e.g. for Sass, generate CSS + source map).

See also:

denisdefreyne commented 6 years ago

Idea: allow compiled content to have multiple “forks” (by default it only has one, e.g. :default). The #write call could then take a fork param, for selecting which fork to write:

compile '/**/*.scss' do
  filter :sass
  write ext: 'css'
  write ext: 'css.map', fork: 'sourcemap'
end

Same for #route presumably.

It needs more thought around how to run filter and layout on different forks. But maybe that’s not needed.

opatry commented 2 years ago

Hi @ddfreyne I would be interested by this capability.

In my setup, I have several images put in content/. From them I generate up to 4 representations of each.

I guess having a single filter letting me load the image once and output it in various formats could speed up things. Currently, I'm using system(convert …), don't know if imagemagick can do several processing at once though.