seattlerb/zenweb

Zenweb should warn users if a file has an extension for which a renderer is unknown

Closed this issue · 6 comments

If I have a file "foo.html", it gets generated to the site.

If I have a file "foo.html.bar", and there is a known renderer for "bar" files, then the renderer is run and "foo.html" is generated to the site.

If I have a file "foo.html.bar" and there is no known renderer for "bar" files, then the file is silently ignored.

Zenweb would be a more considerate site generator if it warns me that I appear to be missing a renderer.

On Sep 3, 2012, at 21:25 , Mike Dalessio notifications@github.com wrote:

If I have a file "foo.html", it gets generated to the site.

If I have a file "foo.html.bar", and there is a known renderer for "bar" files, then the renderer is run and "foo.html" is generated to the site.

If I have a file "foo.html.bar" and there is no known renderer for "bar" files, then the file is silently ignored.

Zenweb would be a more considerate site generator if it warns me that I appear to be missing a renderer.

That means I have to have stub methods for EVERY type of file that might be legit... pdf, txt, etc.

Is there some sort of middle ground you can think of?

Sure. Middle ground would be, generate the file. So in the above case, the .site directory would contain foo.html.bar.

it could warn if -t... ?

We could have an array of registered final extnames to not warn on... sensible defaults and user configurable.

Really, I think that's overkill. I'd be happy if the file "foo.html.bar" got generated (i.e., copied) to the .site hierarchy. This would remind me that I messed up.

OK. I was assuming that it already copied in unknown files but it doesn't. Sorry. I spaced. What it DOES do right now is warn you about any unknown types if -t is used. I'm further extending this so you can add new extensions easily:

Zenweb::Site.binary_files << "jpeg"
Zenweb::Site.text_files << "xml"

Sorry for the delay. Lemme know if this doesn't address your concerns.