Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jekyll source validation #502

Open
jayvdb opened this issue Mar 20, 2018 · 5 comments
Open

Jekyll source validation #502

jayvdb opened this issue Mar 20, 2018 · 5 comments

Comments

@jayvdb
Copy link
Member

jayvdb commented Mar 20, 2018

html-proofer is the most commonly used validator of jekyll sites, and it operates on the rendered version of the site.

By combining various existing coala plugins, and improving the YAML bears, coala could do equivalent validation on the source version of the site.

An important aspect of the YAML validation is ensuring that it can be round-tripped. i.e. read into a library, modified, and emitted again with only the modifications being in the diff.

https://pypi.python.org/pypi/ruamel.yaml is one attempt at doing this, but it often requires overwriting the reader and writer to ensure round-tripping.

https://github.com/nexB/saneyaml is a new attempt at doing this.

A possible mentor of this project is @pombredanne

@jayvdb
Copy link
Member Author

jayvdb commented Mar 20, 2018

https://github.com/18F/jekyll_frontmatter_tests is another jekyll plugin that is prior art.

@pombredanne
Copy link

@jayvdb FWIW, https://github.com/nexB/saneyaml that I maintain does not make any serious attempt at roundtripping. Instead it focuses on trying to get readable YAML out and avoid falling into too many YAML traps in ... which in some cases could amount to rountripping. https://pypi.python.org/pypi/ruamel.yaml seems a better solution if you want to go strict.

@jayvdb
Copy link
Member Author

jayvdb commented Mar 21, 2018

ruamel.yaml is only good at a subset. It would be interesting what subset of syntax saneyaml can roundtrip. That isnt something that we need to determine now.

I think the application phase & community bonding phase of this project should be about assessing the available yaml libraries to select the best roundripper for the most suitable set of yaml needed for typical front matter.

I would suggest that about 1/3 of this project is improving the chosen yaml library to iron out the wrinkles, so an important consideration for choosing the yaml library will be how suitable the project is to being enhanced.

@jayvdb
Copy link
Member Author

jayvdb commented Mar 21, 2018

The yaml 1/3 of this project should be the first third IMO , as building a well defined subset of yaml which can be roundtripped will assist #502 , so that the yaml schema chosen is able to be roundtripped, which will be necessary as gitmate has a web-editor of the settings which needs to serialize changes back into YAML.

@jayvdb
Copy link
Member Author

jayvdb commented Mar 21, 2018

Probably also want to include https://github.com/adrienverge/yamllint in the scope of this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants