GreenDelta / olca-app

Source code of openLCA
openlca.org
Mozilla Public License 2.0
193 stars 43 forks source link

Credits file generator #325

Closed nishahs08 closed 1 year ago

nishahs08 commented 1 year ago

This PR introduces a JS based credits file generator that retrieves a copy of license for each credit url and generates an html block that is later injected into the template.

To generate a template file all we need to do is run - node credits-gen.js from credits directory.

nishahs08 commented 1 year ago

Hi @msrocka. Thank you for credits.py. I was actually having some troubles related to text parsing in python arising from presence of script and style tag in my template html or maybe because of the content in them. I couldn't figure out why so I moved the python based generator to JS and that fixed the issue for me. If this PR looks good then I will also add a small commit to remove the credits.py.

msrocka commented 1 year ago

Many thanks, this looks really nice. I will merge it but please do not delete the Python script. (a small thing: in the getLicenseText function it could first check if the cache file exists before trying to read it)