Statiq.Web icon indicating copy to clipboard operation
Statiq.Web copied to clipboard

Add a Validate module

Open deanebarker opened this issue 10 years ago • 3 comments

This would be the document-centric companion to ValidateMeta. This would be for validation of the document as a whole, not just a single meta value. Examples:

Validate()
   .WithAssertion(d => !String.IsNullOrWhitespace(d.Content), "Document has no content.")
   .WithAssertion(d => d.Meta.ContainsKey("Gumby"), "Meta key \"Gumby\" is deprecated.")

It should function more or less the same was as ValidateMeta, just in ways that make sense for an entire document.

I'll write this over the weekend.

deanebarker avatar Feb 12 '16 19:02 deanebarker

I love the API you ended up with for the ValidateMeta module, and this seems like a natural and valuable extension of that idea. :+1:

daveaglick avatar Feb 12 '16 22:02 daveaglick

I guess this one should be closed? http://wyam.io/modules/validatemeta

miere43 avatar Feb 29 '16 19:02 miere43

@miere43 I think this is supposed to be a more document-level validation module. Whereas ValidateMeta validates individual metadata values, this one will validate document content, combinations of metadata, etc.

daveaglick avatar Feb 29 '16 20:02 daveaglick