3 ms·
I switched to this years ago with some Python code which uses the data embedded in the HTML source to generate things like feeds or re-applying templates. I've
by acdha 7y ago
I switched to this years ago with some Python code which uses the data embedded in the HTML source to generate things like feeds or re-applying templates. I've mostly neglected it for years but am generally happy with the approach of developing templates interactively and then having a script which just pulls values across using selectors (e.g. take [itemprop="articleBody"] from the original page and use its children to set the contents of [itemprop="articleBody"] on the template). This was nice for allowing you to do anything you want at any time without having to fight a templating system or CMS structure.
https://github.com/acdha/simple-cloud-site/blob/master/simple_cloud_site/templates.py https://github.com/acdha/simple-cloud-site/blob/master/simpl...
I like the approach of using the same data values (schema.org microdata, meta headers, etc.) which other things use to keep you honest about that: e.g. https://chris.improbable.org/2014/8/25/adventures-in-unicode-digits/ https://chris.improbable.org/2014/8/25/adventures-in-unicode... extracts to http://microdata-extractor.improbable.org/extract/?url=https%3A%2F%2Fchris.improbable.org%2F2014%2F8%2F25%2Fadventures-in-unicode-digits%2F http://microdata-extractor.improbable.org/extract/?url=https... without any need to be careful updating the system because if it didn't, the missing data would be immediately obvious.