Cloud-Awesome / markdown-maker

Lightweight library to assist creation of .md files (in GitHub and/or DocFX flavours)
MIT License
0 stars 0 forks source link

Validate all components of MdDocument before output #10

Open Cloud-Awesome opened 3 years ago

Cloud-Awesome commented 3 years ago

Before deleting and creating a new file, validate the output

Cloud-Awesome commented 2 years ago

Perhaps the best way is to make the Validate function, part of the IDocumentPart interface, and just loop through those?

Would need to be recursive though, for grandchildren... Or, given we have a distinctive list of which child elements always have children, the grandchild validation could be part of the child validators?

Finally, probably need to review the validate functions themselves, as they currently throw the exception, which wouldn't work when we want a full list of errors. Nice wee bit of refactoring required there ;)