LMFDB / lmfdb

L-Functions and Modular Forms Database
Other
246 stars 199 forks source link

Validate HTML templates #3106

Open AndrewVSutherland opened 5 years ago

AndrewVSutherland commented 5 years ago

In addition to running pyflakes on our python source code as a standard part of our testing, it would be nice to similarly validate all of our HTML templates.

There are a number of standard programs that exist for this purpose (e.g. tidy), the challenge is to find a tool that is flexible enough to let us use it to validate templates (which in general are not valid as stand alone html files) without generating a lot of spurious error messages.

edgarcosta commented 5 years ago

Here is something along the same lines but only for Jinja2: https://stackoverflow.com/questions/37939131/how-to-validate-jinja-syntax-without-variable-interpolation or https://groups.google.com/forum/#!topic/salt-users/1ZYVGn5BnzQ and here is a possibility that perhaps can work for HTML validation with jinja, as they say This was written with static site generators like Jekyll and Pelican in mind. https://github.com/svenkreiss/html5validator