Pristine icon indicating copy to clipboard operation
Pristine copied to clipboard

Improve documentation

Open luca-vercelli opened this issue 5 years ago • 1 comments

I spent a lot of time creating custom validators, later realizing that the same results could already be achieved with the standard validators. I have written some more realistic examples here: https://codepen.io/luca-vercelli/full/KKzMJvR

(please notice that the Pen points to the CDN https://combinatronics.com/Sha256/Pristine/master/dist/pristine.js )

I think the http://pristine.js.org/demo.html page could be reorganized that way:

  1. Common validations
  2. Real-world examples (@sha256 this could point to my Pen, or you could create a similar one)
  3. Custom validator to a specific field
  4. Custom global validator

and the example "Custom error messages" can be omitted.

Second issue, I think that the "Demo" link in README.md file should not be in a title, it took me a while to realize it was a link.

Third issue, the "API" section of the README.md file could be moved in a separate file.

If you agree, I could work on this.

luca-vercelli avatar Aug 20 '20 07:08 luca-vercelli

@luca-vercelli, I think Real-world examples can be at #1 and point to the Pen you made. So the flow would be like this:

  1. Real world examples 2 - 5: General demo examples

I would suggest to keep "Custom error messages" example too because someone may need a quick example of how this can be done.

I agree with the Demo link. Also the text just below it, is misleading too.

But I think the API section is fine where it is, at least for now. The goal is to keep the readme file self sufficient. So you don't need to look into other places if you read it carefully.

sha256 avatar Aug 20 '20 10:08 sha256