mikeboers / Flask-Images

On-demand resizing of images for Flask applications.
https://mikeboers.github.io/Flask-Images/
BSD 3-Clause "New" or "Revised" License
81 stars 43 forks source link

Improve docs re: configuration and examples #22

Open cbronazc opened 10 years ago

cbronazc commented 10 years ago

IMAGES_PATH seems to only work as a list, can someone at least put this in the docs. IMAGES_NAME, I can't for the life of me figure out what this does Also it would be nice to have the from flask.ext.images import resized_img_src or url_for somewhere in the docs.

mikeboers commented 10 years ago

Thanks for your feedback!

The docs currently reside entirely in the README.

IMAGES_PATH could be a bit clearer, I agree, but IMAGES_NAME is described with the rest of the configuration.

The introduction covers the resized_img_src and url_for use cases; are you saying this is not enough, or was not visible enough?

Cheers,

Mike

cbronazc commented 10 years ago

That was a quick response, I can submit a PR for the README IMAGES_PATH and url_for part if you want.

For IMAGES_NAME, I saw that part in the configs, but I don't understand what "The name of the registered endpoint" means. Is that the endpoint of the flask view method ? Whats the purpose of setting this variable ? It doesn't affect the generated url at all, or the location of the image storage or declare it as a set or anything. I read through the code but I'm just not grasping it.

I get how url_for and the other is used, but newbies might have a hard time understanding that you need to import them from this package, not from flask import x but from flask.ext.images import x. Putting that right above "Configuration" would be helpful.

Thanks!

mikeboers commented 10 years ago

Fair enough on all points. Some examples and slightly more conventional docs all around would be good. I also think that is one of the very last missing criteria for "approved" Flask extensions.

IMAGES_NAME is the endpoint of the Flask view method. Setting it allows for avoiding conflicts with another endpoint called "images". Without doing any research and just answering off the cuff, I'm 50-50 on if that sort of thing could/should be solved with blueprints.

mikeboers commented 10 years ago

I'm going to leave this open as the last thing to do for #11.

crifan commented 8 years ago

Thanks for cbronazc's notice, otherwise I would still be crazy for Flask-Images not working. Now I NOTICE that, the IMAGES_PATH is a list, not a single path string. change my: IMAGES_PATH = "static" to: IMAGES_PATH = ["static"] then made it work!